|
-
Apr 27th, 2011, 08:32 PM
#1
Thread Starter
Addicted Member
PostMessage or SendMessage not working.
First of all, is it even remotely possible to have PostMessage or SendMessage "press keys" inside of a Fullscreen game? I.e. use the Chat? (Requires the user to activate the chat box, type in the message, then send it, which is all done with the keyboard)
I've tried many different ways using WM_KEYDOWN and WM_CHAR, and nothing worked.
Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, _
ByVal lParam As Any) As Long
I call it like this:
Code:
Dim myp = process.GetProcessByName("game")
SendMessage(myp(0).handle, WM_CHAR, 13, 1&)
Same goes for PostMessage, 13 is the keycode for Enter, and 1& is how many times I want it to be pressed. WM_CHAR sends the Message as a Character.
I have tried the same as above with WM_KEYDOWN and changing 1& to 0&
I am trying to get it to activate the user's chat by pressing enter, type in the text, then press enter again. Except, I would like for the game to be minimized and allow this to work. Or, if while the game was running in fullscreen, that I was able to use SendMessage or PostMessage to type text into a Command Prompt Window.
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|