How can I check which device button was pressed?

  • Thread starter Thread starter Maciej Wolniewicz
  • Start date Start date
M

Maciej Wolniewicz

Hello,

Maybe I will describe what i want to achive.

I have form with some controls, it is information about somebody:
name, address, phone etc. what I want to do is when I have PocketPC
with phone included when I press talk button (button with green phone)
I want to read phone number (if any exist) and try to dial this
number. I have this already done as menu option, but I think it is not
very user friendly. I reallly do not know where I should start to look
for solution.

Thanks in advance for your help.

Regards,

Maciej Wolniewicz
 
You can also try calling GXOpenInput() from the GAPI. This method will
disable all hardware buttons, so you can just use the KeyDown event on your
Form to see which buttons were pressed. A very dirty way of doing it, but it
works :)

Just call GXCloseInput() afterwards...


[DllImport("gx.dll", EntryPoint = "#9")]
private static extern int GXOpenInput();

[DllImport("gx.dll", EntryPoint = "#3")]
private static extern int GXCloseInput();
 
Thanks for yours answers. Fabian's solution I think is safe. Christian
in your solution is a danger, that when something goes wrong and I do
not call GXCloseInput I will disable all hardware buttons permanently,
but still thanks for answering my question.
Now I'm going to try to implement it. Wish me luck.

Regards,

Maciej

You can also try calling GXOpenInput() from the GAPI. This method will
disable all hardware buttons, so you can just use the KeyDown event on your
Form to see which buttons were pressed. A very dirty way of doing it, but it
works :)

Just call GXCloseInput() afterwards...

[DllImport("gx.dll", EntryPoint = "#9")]
private static extern int GXOpenInput();

[DllImport("gx.dll", EntryPoint = "#3")]
private static extern int GXCloseInput();

--
Regards,
Christian Resma Hellehttp://christian-helle.blogspot.com




You can unregister your hotkeys with the following functions :
UnregisterFunc1 and RegisterHotKey and then override the WndProc and
catch the VK_TTALK message.

Fabien Decret (Device Application Development MVP)
Windows Embedded Consultant

- Poka cytowany tekst -
 
Back
Top