Paul
Fri Sep 29 10:52:29 CDT 2006
To make a form react to a function key, register a hot key and your form
will get a WM_HOTKEY message when the key is pressed. Again, you don't want
to steal the focus from things like Textbox controls or they won't work. I
think that there has been traffic previously that describes calling
RegisterHotKey() (which you have to P/Invoke), and handling the resulting
WM_HOTKEY message sent when the key is pressed.
You can search the archives of this group in:
http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8
If you just search on RegisterHotKey, you'll find that there are limitations
to what you can register for, how to catch the message that results, etc.
Paul T.
"steel" <SteelWhite@gmail.com> wrote in message
news:1159496524.010558.28590@k70g2000cwa.googlegroups.com...
> Paul, thanks a lot for your guidance. I have leant it,
>
> The reason of a form always be focused is that: It can make the form
> react with the FunctionKey at any time. In my device there are some
> FunctionKeys and a small keyboard, the FuctionKeys should be responsed
> at the instance the user push it. So I let the Form always Focused to
> recieve all key event and dispatch the non-FunctionKey event to the
> cotroll in it.
>
> Does you has better solution?
>
> your help will be very appreciated.
>