| View previous topic :: View next topic |
| Author |
Message |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Wed Aug 20, 2008 3:45 am Post subject: sending mouse clicks with PostMsesage |
|
|
I'm trying to simulate a left mouse click with PostMessage. I have the code, but it doesn't seem to work.
| Code: |
PostMessage(hwnd, WM_LBUTTONDOWN, NULL, MAKELPARAM(561, 353));
PostMessage(hwnd, WM_LBUTTONUP, NULL, MAKELPARAM(561, 353));
|
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Wintermoot Expert Cheater
Reputation: 0
Joined: 08 Nov 2007 Posts: 198
|
Posted: Wed Aug 20, 2008 6:10 am Post subject: |
|
|
| What is the problem? Does it click at all?
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Wed Aug 20, 2008 6:16 am Post subject: |
|
|
| You know that sending a fake mouse click over a button isn't enough, the window respondes to WM_COMMAND, it will completely ignore the mouse clicks.
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Wed Aug 20, 2008 9:11 am Post subject: |
|
|
POINT pos;
GetCursorPos(&pos);
PostMessage(hwnd, WM_LBUTTONDOWN, NULL, pos);
PostMessage(hwnd, WM_LBUTTONUP, NULL, pos);
For PostMessage, it's either &pos or pos. I forgot.
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Wed Aug 20, 2008 9:23 am Post subject: |
|
|
| Symbol wrote: | | You know that sending a fake mouse click over a button isn't enough, the window respondes to WM_COMMAND, it will completely ignore the mouse clicks. |
Well then, is there anyway to send a mouse click to a program if another program has the focus?
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Wed Aug 20, 2008 12:03 pm Post subject: |
|
|
| I was under the impression PostMessage worked even if the target window is not the one in focus ? Stuff I have coded with that function before works even if it's not in focus.
|
|
| Back to top |
|
 |
|