. Net CF system message blocking solution, including the M key, USB status change event compressed package contains a DLL and C # reference Code.
The principle is very simple. Use C ++ to write a DLL and then listen to it in the DLL.SystemMessage. If the message is sent to C # message ***, the message is forwarded to C # message ***.
C # contains a message ***, which receives the message belonging to the window. The corresponding processing is fine.
Exported
Uint mzgethomekeymessage ();
Int registerusbnotifymsg ();
Int getusbconnecttype ();
Three necessary API functions can be called directly.
According to mayaqcn's usage return, unlocking the screen will trigger a USB status change event.
This may be because a Message ID conflicts with a USB message.
SolutionThe solution is: after receiving the USB message, call getusbconnecttype () to determine the USB status. If the status changes, the USB status changes.
Prtscn20091230212142.png(174.23 KB)
-
TestHardwareKey@200912302207.rar
(69.03 KB)