Guest darkmush Posted June 19, 2005 Posted June 19, 2005 (edited) how would i send a keystroke to a minimized game, for example.. CS so lets say i wanted my char to continually jump (ctrl), so i want to send the keystroke for ctrl to the cs window,and put it in a loop, so whether i am in the game, or the game is minimized, id be constantly jumping oh, and the cs window would be called CS for $jump = 1 to 50 (code for jumpiing minimized) next what would the code be and what does this code do? Func sendenter() $hwnd = WinGetHandle($gunzwindow) If $hwnd <> "" Then PostKeyPress($hwnd, 13) EndIf EndFunc Func PostKeyPress($hwnd, $key) $WM_KEYDOWN = 256 $WM_KEYUP = 257 $aR = DllCall("user32", "long", "PostMessageA", "hwnd", $hwnd, "long", $WM_KEYDOWN, "long", $key, "int", 0) $aR = DllCall("user32", "long", "PostMessageA", "hwnd", $hwnd, "long", $WM_KEYUP, "long", $key, "int", 0) EndFunc from what i know, is it takes the window of the game "gunz", and then sends the keycode 13 (enter) to it i changed this keycode to something like space "32", but it doesnt register, and make the char jump what i then did, was press enter myself, which allowed me to type text in, and the spaces that were supposed to be sent to the program periodically were registering into the chatbar how do i make it so taht the game actually jumps, when space is sent, rather than ignore it unless thers a text box to type into Edited June 19, 2005 by darkmush
nobby Posted June 20, 2005 Posted June 20, 2005 It is not possible to send keystrokes to minimized windows. Only way to do it is to use controlsend, but I doubt very much that it will apply to what you need. CheersNobby
Guest darkmush Posted June 20, 2005 Posted June 20, 2005 the code that i posted there was used in someone else's program for pressing enter while the game was minimized, isnt that sending keystrokes? or its actualyl soemthing else
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now