Jump to content

Cant Get _SendMessage to Work


Recommended Posts

Following is my code dont know whats the problem :( 

#include <SendMessage.au3>

 

Local $hWnd = WinGetHandle("Shelton")
$x=327
$y=144

Local $WM_LBUTTONDOWN = 0x0201,

Local $WM_LBUTTONUP = 0x0202
Local $lParam =  BitOR(BitShift(BitAND($y, 0xFFFF), -16) , BitAND($x, 0xFFFF))
_SendMessage($hWnd, $WM_LBUTTONDOWN, 0x0001, $lParam)
_SendMessage($hWnd, $WM_LBUTTONUP, 0x0000, $lParam)

 

used the following for Iparam as well

Local $lParam =  BitOR(Int($y) * 0x10000, BitAND(Int($x), 0xFFFF)) ; HiWord = y-coordinate, LoWord = x-coordinate
    

 

But same...its not working.

Can someone tell me what am i doing wrong...and I dont wanna use Controlclick or send :)

Link to comment
Share on other sites

On 15/03/2017 at 3:24 AM, InunoTaishou said:

What program are you trying to interact with? What are you trying to do?

i need to click on a couner in a program to reset it after every 15 to 20 min but i wanna watch movies without intruption so i tried it with control click as ive previously used it and had experience with it. But dont know why is it not working :(

So i searched further and got to API. But its not working as well :( i wanna learn and use it as this seem much more deep and effiecient but its not working.

Plz help and point out what is lacking :)

Link to comment
Share on other sites

On 15/03/2017 at 0:43 AM, junkew said:

Do you have example of help file up and running.

Mousemove and click can be alternative.

Where is your example based on?

No...it produces intruption....i dont want the program where im clicking to flash up on screen while im doing something else

Link to comment
Share on other sites

On 17/03/2017 at 3:44 AM, InunoTaishou said:

We still don't know what the program is, or what the window information is for the window you're trying to control. Is it run as admin? Does the Autoit info tool show it as a regular button?

Is it neccessary to give a description of the program to be helped :(

Nonetheless, Its a simple program one of my co-worker has made (in C#). Automatically it recieve information from help desk of a greivance redressal system but it does so after 3 hour and reset the counter....i want it to take input after some 30 min for that i need to reset counter after half an hour... I ve all the rights to access info on that tool nothing illegal..just that my superior want to take input after 30 min now which i ve to do manually as im not that deep into programming to change values in the actual program so opted for autoit..

Hope its enuf description....please help :)

Link to comment
Share on other sites

We don't need a description of the program, just the info about the window dude. At this point I don't know if this is a regular button and maybe you were inputting the wrong parameters for ControlClick or, for all we know, this could be some 3D3 button in which case you would have to use the SendMessage method, but again, you might be inputting the wrong parameters. I also wanted to know if your co-workers program is run as admin, because if it is then your autoit script also has to be run as admin to interact with it.

If you don't tell us the info from the AutoIt info tool we can literally do nothing but speculate and make guesses.

Edited by InunoTaishou
Link to comment
Share on other sites

On 18/03/2017 at 8:24 PM, InunoTaishou said:

We don't need a description of the program, just the info about the window dude. At this point I don't know if this is a regular button and maybe you were inputting the wrong parameters for ControlClick or, for all we know, this could be some 3D3 button in which case you would have to use the SendMessage method, but again, you might be inputting the wrong parameters. I also wanted to know if your co-workers program is run as admin, because if it is then your autoit script also has to be run as admin to interact with it.

If you don't tell us the info from the AutoIt info tool we can literally do nothing but speculate and make guesses.

no it doesnt need to be run as an admin...

parameters are fine...when i use mousecick..click is made on the right spot.

and i chekd it with all all modes of para..but no result :(

Link to comment
Share on other sites

On 18/03/2017 at 8:24 PM, InunoTaishou said:

We don't need a description of the program, just the info about the window dude. At this point I don't know if this is a regular button and maybe you were inputting the wrong parameters for ControlClick or, for all we know, this could be some 3D3 button in which case you would have to use the SendMessage method, but again, you might be inputting the wrong parameters. I also wanted to know if your co-workers program is run as admin, because if it is then your autoit script also has to be run as admin to interact with it.

If you don't tell us the info from the AutoIt info tool we can literally do nothing but speculate and make guesses.

if possible can u gimme a working example of send message....

like say it click somewhere (visible that something is clicked) on any window or any program...plz

 

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...