FAQ’s


From time to time I receive questions that are submitted from this blog related to my old blog, so I have decided to create this post as a place holder for the answers. I will continue updating this post by adding answers to the questions as they come along.


Q: When I use your HookKeys class that you posted on your old blog, but it doesn’t work on my smartphone device.


A: When running this code on smarthone (WM Standard) devices, the SetWindowsHookEx API function requires that your application to be signed with at least the developer certificate.


 


Q: I am writing an application on windows mobile phone (smartphone) . When my app is running if I press the VK_TEND/VK_F4 key ( red button on the phone ), our window gets the message “0xC003″(49155). But I am not able to figure out what message is this. How can capture this message?


A: Please see the post about creating keyboard hooks on WM.


 


Q: In your blog post about keyboard hooks you mention that something is missing. What is it?


A: The code that is provided in this blog should be functional. The only part is missing is the code that implements IDisposable interface to handle the scenarios when the HookKeys class goes out of scope and you should unhook messages in the Dispose method.

Comments (4)

  1. moez says:

    Hi Alex

    Thank you for the excellent post about WM system Hooks.

    I’m trying to use the code you posted but with no success : could you please post a simple example demonstrating the usage of the class you provided for global keyboard hooks?

    Best Regards

  2. aldodomingo says:

    I have a problem. VB2008 my application for windows mobile on my Palm Treo Pro, stores the data from my GPS every 5 minutes. But when the phone goes to standby (sleep) the application stops and only works when the phone wakes up. As I can do to never stop working?

  3. aldodomingo says:

    I have a problem. VB2008 my application for windows mobile on my Palm Treo Pro, stores the data from my GPS every 5 minutes. But when the phone goes to standby (sleep) the application stops and only works when the phone wakes up. As I can do to never stop working?