Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


sending mouse clicks with PostMsesage

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
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?

PostPosted: Wed Aug 20, 2008 3:45 am    Post subject: sending mouse clicks with PostMsesage Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Wintermoot
Expert Cheater
Reputation: 0

Joined: 08 Nov 2007
Posts: 198

PostPosted: Wed Aug 20, 2008 6:10 am    Post subject: Reply with quote

What is the problem? Does it click at all?
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Wed Aug 20, 2008 6:16 am    Post subject: Reply with quote

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
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Wed Aug 20, 2008 9:11 am    Post subject: Reply with quote

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
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed Aug 20, 2008 9:23 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed Aug 20, 2008 12:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites