Intercepting Win32 Messages - Control looses Properties

C

CPragash

Hello All,

I am working on a Pocket PC 2003 device with a keyboard built into it.
My requirement is to capture key press events on each control
(textbox, checkbox, list box, etc). I tried capturing the OnKeyDown
event for each control, but could not achieve the behavior I expected
- the up and down arrow key presses were not captured using this event
for check boxes. My next approach was to intercept win32 messages -
based on the article
http://msdn.microsoft.com/msdnmag/issues/04/04/KeyboardSupport/default.aspx
/ another source is the Yao Durant compact .net programming book
chapter 9 which has a similar sample, but on both the samples I had
the same problem. The control is able to intercept key messages - but
it looses properties such as text values or checked values etc. A
simple textbox1.text shows up a blank value where as the designer
shows the textbox with a value "Textbox1". I narrowed down the problem
to a specific function call - the control losses its properties when a
handle of that window is passed to a native dll interceptor written in
MFC or C++. Any thoughts or suggestions would be really really
helpful.

Thanks in advance.

Regards,
Chris
 
P

Paul G. Tobey [eMVP]

"Loses its properties"? That doesn't have an obvious meaning, so you're
going to have to tell us what you mean by that. When you call this
function, what, exactly, happens? The value of the .Text property of an
edit control changes? I doubt that!

Paul T.
 
C

Chris Tacke, eMVP

Native DLL interceptor? What exactly are you doing? An IMessageFilter
implementation in the ApplicationEx of the OpenNETCF SDF would provide what
you're after, at least based on what I think you want it will.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top