Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Can Any one explain how to retrieve the value and modify it of lparam, wparam variable when keystrokes are generated in keyboard hooks?

Thanks in advance
Posted
Updated 2-May-11 8:05am
v2

Usually it is done by overriding the PreTranslateMessage function:

Application level:
http://msdn.microsoft.com/fr-fr/library/cw1sb70c(v=vs.90).aspx[^]

Window level:
http://msdn.microsoft.com/en-us/library/kkbhxcs2(v=vs.80).aspx[^]

However, I don't recommand to change their value...
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 2-May-11 9:54am    
Great solution, a 5+++++
--SA
Olivier Levrey 2-May-11 10:00am    
Thank you SA.
Niklas L 2-May-11 14:20pm    
Good recommendation. 5. If OP wants to change the values using a hook, it's probably nothing I want to have installed on my machine.
If you really mean keyboard hooks, and not just key handling (as Olivier discussed), then the answer to your question is found in MSDN:
LRESULT CALLBACK KeyboardProc(
  int code,       // hook code
  WPARAM wParam,  // virtual-key code
  LPARAM lParam   // keystroke-message information
);
 
Share this answer
 
Comments
Niklas L 2-May-11 14:17pm    
Fived.
Olivier Levrey 3-May-11 3:43am    
Good answer as well. Have my 5.
Thanks for your great replies! First of all, i'm using the hook type of WH_JOURNALRECORD . I understand how to work with the hook but the actuall problem is that i need to update the value of lparam
...... LRESULT CALLBACK JournalRecordProc(int code,WPARAM wparam,LPARAM lparam);
so that i can change character from 'a' to 'A' at the time of keydown and before forwarding the message to the destination window
.
.
and this can be done by overriding using
PreTranslateMessageEx(mesg); function
how to override and how to change lparam value plz explain
thankx...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900