Hacking the window message queue

Discussions About Anything Civilized, Hacking or Not

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

Hacking the window message queue

Postby t3hL33Tn00b » Sun Mar 25, 2007 10:39 pm

hi there guys

im new to the world of GUI's, just started learning about them... and i was wondering if it is possible to send messages to some window's queue from another window..

example: from one window you send the message to the other window to say press a button or something. Also, if its possible to know the ID of the message(perhaps using MHS)...

its hard to put in words since i'm totaly newb to this, but i think you got the idea of what im trying to do

lastly, if it is possible, then can i send a message to some game's message queue? (in order to make the character run, jump, etc)

thanks in advance for the attention
t3hL33Tn00b
I Have A Few Questions
 
Posts: 6
Joined: Mon Feb 26, 2007 1:10 am

Postby L. Spiro » Sun Mar 25, 2007 10:50 pm

and i was wondering if it is possible to send messages to some window's queue from another window..

SendMessage() and PostMessage(), found both in the Windows® API and in the MHS script.
Using the MHS script will allow you to test them before making a full C++ project.


You need to have the handle to the target window.
This is typically found using FindWindow(), also in the Windows® API and in the MHS script.

An example can be found in the help file in the Minesweeper examples.
Search for “extern”.




example: from one window you send the message to the other window to say press a button or something. Also, if its possible to know the ID of the message(perhaps using MHS)...

Although you can send WM_KEYDOWN and WM_KEYUP messages, you are better-off using KeyboardEvent() (MHS script) or SendInput() (Windows® API and MHS script).
A list of all Windows® WM_* messages can be found in the help file in the Predefined Enums section.



lastly, if it is possible, then can i send a message to some game's message queue?

Read above.


L. Spiro
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Postby t3hL33Tn00b » Sun Mar 25, 2007 11:05 pm

dude thats the fastest feedback i ever had

i was ready to check this in a week or so

thanks dude! btw MHS rules!
t3hL33Tn00b
I Have A Few Questions
 
Posts: 6
Joined: Mon Feb 26, 2007 1:10 am

Another issue

Postby t3hL33Tn00b » Mon Mar 26, 2007 9:33 pm

Hi there again

Im going to be bothering you guys another time..

I've ran into a problem now, i can close windows and change the title bar text, but I've been unable to send keystrokes.. Im practicing with notepad.

I do know that i've got to get the handle of the child window "Edit", i do that but when i send WM_KEYDOWN for example, nothing happens at all.

I tried WM_CHAR also, but no success. its kinda confusing all that stuff :x

I've been googleing all sorts of stuff but i cant get this to work.. Does that has anything to do with focus or something? btw im interested in sending keystrokes because i want to send them to games in order to perform an action in the game (jump, fire, etc.)

if any of you gods of programming guys can head me to the right path I would greatly apreciate :)
t3hL33Tn00b
I Have A Few Questions
 
Posts: 6
Joined: Mon Feb 26, 2007 1:10 am

Postby L. Spiro » Mon Mar 26, 2007 11:02 pm

As mentioned before, KeyboardEvent() in the MHS script or SendInput() in the Windows® API. SendInput() also works in the MHS script.

There is an example on botting in the help file.
Search for Minesweeper.


L. Spiro
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan


Return to Social/Unrelated

Who is online

Users browsing this forum: No registered users and 0 guests