I know most of you employ AHK for far more respectable tasks, but I am interested in finding a way to utilize it to send keystrokes to a minimized window of a game I play called EverQuest.
I performed many searches and saw some previous posts about games such as ShadowBane, Starcraft, etc. etc. but have not found anyone seeking EQ related support, but the purpose of the script I want to write is very basic.
I have tested and found that the SEND command DOES work and will send keystrokes to the game window when it is active. However, I cannot seem to get Controlsend to function correctly. I am unsure if I am simply not identifying the window adequetely or if the game won't allow input in this manner.
I downloaded Winspector and checked the window messages while running my Controlsend script that sent a few characters to the EQ window and it does appear that the window was receiving some messages such as WM_KEYDOWN, WM_CHAR, and WM_KEYUP, etc. but the text didn't appear to make it to the game as it should have. Perhaps the control that allowed text simply wasn't "topmost", but I also tried using the ahk_parent parameter to no affect.
Then I figured maybe I needed to use PostMessage. Postmessage seems to be some pretty intensive stuff, and being a complete noob I am feeling alittle out of my league to figure it all out. I figured I needed to Postmessage WM_CHAR (0x102) and then find out what the damn code value was for the wparam and lparam for the key I wanted sent, but my attenpts at searching MSDN and Google for some sort of key code listing have been fruitless. The best I could find was simply checking character map, or using Winspector and hitting the key and seeing what the message indicated as the value. This however doesn't seem to match with other examples I have found for using PostMessage WM_CHAR, however.
So, my hope is someone might be able to help a poor hapless entertainment seeker such as myself out alittle bit and lend me a few pointers. Any information on why my game would allow the Send command, but would not allow Controlsend? or PostMessage?
Also, I tried the following script to get a feel for PostMessage, and it did not work on my system. It opened Workpad but did not type text in the text input control.
Run, wordpad WinWait, Document - WinActivate start = 0 Loop { PostMessage, 0x102, %start%, 1, RICHEDIT50W1 ++start if start > 600 ; This test indicates that it's not receiving multi-byte chars. break }
The only thing I can imagine is that either some Windows update patch prevents this from working, or something in my msconfig has been disabled that needs to be enabled.
Any help would be GREATLY appreciated, thanks!