Jump to content


Photo

[AHK_L 64-bit] ControlGet, OutputVar, Selected... [ERROR]


  • Please log in to reply
4 replies to this topic

#1 rousni

rousni
  • Members
  • 131 posts

Posted 03 December 2011 - 03:27 PM

ControlGet, TEXT, Selected,, Edit1, Title    ; TEXT = "" (ErrorLevel = 1)

a workaround:

ControlGetText, TEXT, Edit1, Title
ControlGet, TEXT, Selected,, Edit1, Title ; TEXT = OK (ErrorLevel = 0)

AHK Basic is OK
AHK_L 32-bit is OK

#2 Lexikos

Lexikos
  • Administrators
  • 8853 posts

Posted 03 December 2011 - 10:37 PM

Works for me.

#3 rousni

rousni
  • Members
  • 131 posts

Posted 04 December 2011 - 12:05 AM

Gui, Add, Edit,, qwertyuiop qwertyuiop
Gui, Show,, Title
Sleep, 5000 ; selecting some text
SoundBeep
ControlGet, TEXT, Selected,, Edit1, Title
MsgBox %TEXT%`nErrorLevel = %ErrorLevel%	; TEXT = "" (ErrorLevel = 1)

AHK_L 64-bit, v110503; Windows 7
Some time earlier it was ok; i can't say from wich version my (?) problem appeared.
In any event, I tried with the ANSI version, 32 bit version of AHK_L and basic version, and it is OK, therefore i think there is something wrong with AHK_L 64 bit

#4 Lexikos

Lexikos
  • Administrators
  • 8853 posts

Posted 04 December 2011 - 07:28 AM

I was able to reproduce it with your exact code. However, if I remove SoundBeep and/or Sleep, the script works. If I sleep for 3 - 9 seconds or 15 seconds, it fails, but if I sleep for 2 or 10 seconds it works. It doesn't seem to be a simple matter of an error in ControlGet. :?

Edit: EM_GETSEL expects two "pointer to a DWORD value" parameters, but DWORD_PTR was used instead. Since it is 64-bit on x64, the upper 32 bits were left uninitialized, hence the random behaviour described above. This will be fixed in the next update.

#5 rousni

rousni
  • Members
  • 131 posts

Posted 05 December 2011 - 04:56 PM

Thank you for the new update!