i try to re开发者_运维问答gister a hotkey for a windows mobile application but i can't override System.Windows.Forms.Form.WndProc because there's no definition found.
What am I missing to override this method?
Use a MessageWindows class as the target for RegisterHotKey call. You can overrride its WndProc and use that to receive the hotkey messages.
Seems like it's not possible. If you look here, the WndProc
method doesn't have that Compact Framework icon. That means it isn't available.
For reference, Form.WndProc
lists the following target platforms:
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
Whereas Control.Update
lists:
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
This post also suggests it isn't possible, and points to a workaround here. There's also an article over at CodeProject that seems to make use of that workaround.
精彩评论