Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Control, Key Trapping

Status
Not open for further replies.

williegofar

Programmer
Feb 3, 2003
11
GB
Hi,

I have a list control object. Within that object I want to be able to trap key presses to allow other processes to 'kick off'. I have been able to get this to work via the LVN_KEYDOWN message.

My problem however, is that is that I don't want the list control to also carry out it's normal process in response to such a keypress. In other words, if I have an entry in my list 'ABCD' and the user presses 'A', I don't want anything in the list to change, at present the selection changes to highlight the 'ABCD' record. Anyone got an idea on how to prevent this?

Thanks.
 
You could try to intercept the WM_KEYDOWN messages by hooking the windows procedure of the listbox.
Greetings,
Rick
 
Thanks for the reply.
I'll go and find some info about hooking (like what is it!, lol)
 
Check out SetWindowsHookEx for that....
Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top