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 


WinAPI: EXTRA WM_CHAR in keystroke?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
lucidity
Advanced Cheater
Reputation: 0

Joined: 16 Feb 2011
Posts: 91

PostPosted: Sat Aug 27, 2011 3:15 pm    Post subject: WinAPI: EXTRA WM_CHAR in keystroke? Reply with quote

I've been trying to determine where these extra messages are coming from and I'm fairly sure it is TranslateMessage()

My background isn't in desktop programming so this stuff is a bit over my head.

Are keyboard accelerators a solution, or is there some way to skip TranslateMessage? I can't determine how to use either since they both appear to require you to have control over the message loop itself of the program/thread for which you are posting messages.

Code:
' VB Example Code (Values used in place of param builders for simplicity)

' KeyDown
PostMessage(WindowHandle, WM_KEYDOWN, &H11, &H1D0001)
PostMessage(WindowHandle, WM_KEYDOWN, &H33, &H40001)

' KeyUp
PostMessage(WindowHandle, WM_KEYUP, &H33, &HC0040001)
PostMessage(WindowHandle, WM_KEYUP, &H11, &HC01D0001)


MANUAL INPUT
P WM_KEYDOWN nVirtKey:VK_CONTROL cRepeat:1 ScanCode:1D fExtended:0 fAltDown:0 fRepeat:0 fUp:0
P WM_KEYDOWN nVirtKey:'3' cRepeat:1 ScanCode:04 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
P WM_KEYUP nVirtKey:'3' cRepeat:1 ScanCode:04 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
P WM_KEYUP nVirtKey:VK_CONTROL cRepeat:1 ScanCode:1D fExtended:0 fAltDown:0 fRepeat:1 fUp:1

PROGRAMMATIC INPUT
P WM_KEYDOWN nVirtKey:VK_CONTROL cRepeat:1 ScanCode:1D fExtended:0 fAltDown:0 fRepeat:0 fUp:0
P WM_KEYDOWN nVirtKey:'3' cRepeat:1 ScanCode:04 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
P WM_KEYUP nVirtKey:'3' cRepeat:1 ScanCode:04 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
P WM_CHAR chCharCode:'0033' (51) cRepeat:1 ScanCode:04 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
P WM_KEYUP nVirtKey:VK_CONTROL cRepeat:1 ScanCode:1D fExtended:0 fAltDown:0 fRepeat:1 fUp:1


All I want is for that red line to not appear Sad


Keyboard Accelerators http://msdn.microsoft.com/en-us/library/ms646337%28v=vs.85%29.aspx
TranslateMessage() http://msdn.microsoft.com/en-us/library/ms644955%28v=vs.85%29.aspx
DispatchMessage() http://msdn.microsoft.com/en-us/library/ms644934%28v=vs.85%29.aspx

_________________
» Antec Twelve Hundred Full Tower » EVGA E760 CLASSIFIED » EVGA GeForce GTX 580 SuperClocked 1536MB » i7-980XE » CORSAIR DOMINATOR 6GB PC3 12800 DDR3 » OS: Intel X25-M SSD » Game Storage: Raid-0 2 x WD VelociRaptor 10000 RPM » CE Cache Drive: 500GB WD Caviar » Power Supply: OCZ Z Series Gold 1000W
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