Sign in to follow this  
Followers 0
DjErase

ControlSetText doesn't Work but ControlGetText works well

8 posts in this topic

Hi Everyone,

I need help. I made an autoit script long time ago on Windows XP and all was working well. It sends and retrieves values to Edit control without problems.

Now I upgraded to Windows 7 and the ControlSetText, doesn't work (only this function) and only with Tradestation. If I use notepad.exe and try to send text, all is working fine. I use the same version of Tradestation on both XP and W7. I try to upgrade Tradestation on the Win7 computer but ControlSetText doesn't work (the function return a 0, I also try ControlFocus before but it's the same).

How can I debug this ?

Thanks and sorry for my English.

Share this post


Link to post
Share on other sites



Examine the control with AU3Info.exe and post the contents of the "Summary" tab so we can look and the Class and attribute info.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Examine the control with AU3Info.exe and post the contents of the "Summary" tab so we can look and the Class and attribute info.

:)

Very thanks but I cannot access the computer at this time, I'll send it tomorrow.

Regards.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

>>>> Window <<<<

Title: TradeStation 8.8 - Desktop #1 - Janv 2011

Class: ORPLAT.EXE TRADESTATION

Position: 139, 16

Size: 1327, 689

Style: 0x14CF8000

ExStyle: 0x00000110

Handle: 0x00050206

>>>> Control <<<<

Class: Edit

Instance: 13

ClassnameNN: Edit13

Name:

Advanced (Class): [CLASS:Edit; INSTANCE:13]

ID: 1156

Text:

Position: 172, 48

Size: 52, 23

ControlClick Coords: 31, 11

Style: 0x50012080

ExStyle: 0x00000204

Handle: 0x00010428

>>>> Mouse <<<<

Position: 350, 125

Cursor ID: 13

Color: 0xFFFFFF

Edited by DjErase

Share this post


Link to post
Share on other sites

That edit control appears to have the readonly bits set.

Can you manually enter a value in the control?


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

That edit control appears to have the readonly bits set.

Can you manually enter a value in the control?

Hello,

Yes, I can manually write in this edit box. And this "phenomena" appears only in Win7.

Where can you see that the control is in read only mode ?

I found a peace of code to force the read only bit:

#Include <GuiEdit.au3>
opt("WinTitleMatchMode",2)
Run("Notepad") 
$hWnd = ControlGetHandle("Notepad","","Edit1")
msgbox(0,"","Setting Notepads Edit control to read only")
_GUICtrlEdit_SetReadOnly($hWnd, True)
Sleep(5000)
msgbox(0,"","Setting back to normal")
_GUICtrlEdit_SetReadOnly($hWnd, False)

Regards.

Edited by DjErase

Share this post


Link to post
Share on other sites

I found the answer : It was the User Account Control settings that wasn't deactivated.

Share this post


Link to post
Share on other sites

I found the answer : It was the User Account Control settings that wasn't deactivated.

What do you mean by User Account Control settings ?

I am having the same problem, can you post your code ?

Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0