i’m triyng to use sendmessage to send some message to an external application trying to simulate some keystrokes.
Well, the external program is divided in 2 different windows. the first one is the classic dos windows (C:\Windows\system32\cmd.exe) and here i’ve no problems. I use a sendmessage passing the 7 message (wm_setfocus) and then i pass a message 256 with some chars as w parameter (for example 89 for y and 13 for the return key). All works fine, in the window appears the y and the return go. and a new window is opening. But, this new window is a graphical one, probably opengl. And in this new window i must send other keystrokes (for example a “p” key and a “r” key. but using the same technique as i did before nothing happens. the only difference is the type of window. It’s possible to send keystrokes in other ways apart from the sendmessage one?
thanks all ;)
i’ve attached a simple patch to better explain the problem. Here i’m launching a windows terminal window and a notepad. The first accept correctly the focus message and the keystrokes, the second dosen’t accept it.
because of the different naming of the windows in differents os languages you must write in a string a piece of the name of the window you have (the patch should be self explanatory).
thank you so much ;)
uff, just for update, i’ve found an old post and using another method i can now write in the notepad (using the keyboard global input pin). The problem is that this method too dosen’t work with the window i need to control :(
hi, i’m using SendKey V1.0 (Write by sebastien bloc email@example.com | www.mignonsoft.com) to send shortcut to specific windows.
i hope this method will work for you.
Send shortcut and more to specific windows from v4. (79.7 kB)
thanck you nzo.nzo, unfortunately, it dosen’t help. It works fine in almost all the windows except the one i need :( i’ve tried with the process instead of window, but without results :(
anyway thanks ;)