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 


PostMessage Sending Twice ?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sat Aug 16, 2008 12:57 pm    Post subject: PostMessage Sending Twice ? Reply with quote

I was under the impression that with windows messages for key presses, I would have to send a WM_KEYDOWN and then a WM_KEYUP but I found that when I did this, the 2 messages that were put onto the message queue resulted in the message being sent twice ?!

For example, if I send the letter 'a' to notepad with the above method, it weirdly results in notepad displaying 'aa' and so on. It works perfectly once I remove the WM_KEYUP but I just find it a bit odd. Surely when a key is pressed (at a hardware level) two messages are sent to the message queue then ?
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sat Aug 16, 2008 1:20 pm    Post subject: Reply with quote

I think its simply because u sent 2 messages. ONe for key down one for key up. But I don;t know if Im right thou.
Back to top
View user's profile Send private message
Zand
Master Cheater
Reputation: 0

Joined: 21 Jul 2006
Posts: 424

PostPosted: Sat Aug 16, 2008 5:32 pm    Post subject: Reply with quote

I think it's because you sent keydown???

So it presses the key down until you release it.

Use WM_CHAR once for what you're doing
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sun Aug 17, 2008 3:41 am    Post subject: Reply with quote

Well the call to KEYUP is directly after the call to KEYDOWN. I just figured that when you press a key by hand that is what happens, key goes down then back up. I will try your suggestion then.
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