Jump to content

_SendMessage()


Recommended Posts

I've gotten to the point of realizing i would need to use $WM_KEYDOWN and $WM_KEYUP or $WM_CHAR and probably something like "0x"&_StringToHex("a") but every combination i have tried has not worked im testing for notepad.

And yes i have searched and cannot find anything.

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Link to comment
Share on other sites

Why don't you just use Send() or ControlSend()?

I knew i should have mentioned this Send() only works when the window is active and ControlSend() only works with a control.

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Link to comment
Share on other sites

I've gotten to the point of realizing i would need to use $WM_KEYDOWN and $WM_KEYUP or $WM_CHAR and probably something like "0x"&_StringToHex("a") but every combination i have tried has not worked im testing for notepad.

And yes i have searched and cannot find anything.

What do you have (some snippet) with _SendMessage()?
Link to comment
Share on other sites

What do you have (some snippet) with _SendMessage()?

This is my current test:

#include <String.au3>
#include <SendMessage.au3>
#include <windowsconstants.au3>

_SendMessage(WinGetHandle("Untitled - Notepad"),$WM_CHAR,"0x"&_StringToHex("a"),0,0,"int","long")

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Link to comment
Share on other sites

Link to comment
Share on other sites

... yes i know this but some programs are built to specifically block that method.....

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Link to comment
Share on other sites

Games with guards are usually the only programs built to do that. If you're making a game bot say so, you'll get more specialized help. I think all of us were assuming you were trying to send a message to another program you'd written. I really only brought up ControlSend() again specifically because of this:

I knew i should have mentioned this Send() only works when the window is active and ControlSend() only works with a control.

Edited by dbzfanatic
Link to comment
Share on other sites

If it were a program i had written i would have used controlsend or another method but it is not a game bot either its just built like one it has no protection but i has no controls and it will not accept controlsend.

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Link to comment
Share on other sites

What program is this? Perhaps someone here has experience with it. I personally know that java programs don't usually present anything of much value for automation so is it a java app?

Link to comment
Share on other sites

What program is this? Perhaps someone here has experience with it. I personally know that java programs don't usually present anything of much value for automation so is it a java app?

Well i am not going to mention the program as it is a private app and im not supposed to tell anyone im testing if it is actually possible to send keys to the window for the creator of it.

EDIT:In any case im just trying to figure out why _SendMessage() wont work the way im using it according to msdn im using it correctly but it will not send to notepad.

Edited by MerkurAlex

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Link to comment
Share on other sites

Link to comment
Share on other sites

Well from the autoit helpfile it says you have to use the message number and not the message itself so try that.

uummm what do you think the variable im using equals?

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Link to comment
Share on other sites

$WM_KEYDOWN is a string. It's defined as a hex number yes but as passed it's still a string, or seems to react that way. Try $WM_CHAR instead of keydown (WM_CHAR = &H102) and pass the hex key to the wparam, lparam is repititions, scan code,extended,etc.

Link to comment
Share on other sites

$WM_KEYDOWN is a string. It's defined as a hex number yes but as passed it's still a string, or seems to react that way. Try $WM_CHAR instead of keydown (WM_CHAR = &H102) and pass the hex key to the wparam, lparam is repititions, scan code,extended,etc.

heh if you look above at my snippet im using WM_CHAR and that &H102 is for VB my friend.

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...