Console App: waiting in Background for a Hardware-Button?

  • Thread starter Thread starter Boris Nienke
  • Start date Start date
B

Boris Nienke

Hi,

is it possible to write a PocketPC-Console Application that stays in
background and waits for a hardware-button-click to do something?

I like to avoid starting/terminating the application all the time -
currently i simply linked a button with that application via
WinMobile2003-settings. But starting a .Net-Application consumes time and i
like to react as soon as possible if the user presses a (specific and
selectable) button.

So i have two ideas:
1.) just link the application to a button with WM2003 just like now. But
don't terminate the application.
Problem: i don't know:
- how to NOT terminate the console-app after it has done something
- how to get informed by the system, that the console-app has "started"
again (if the user presses the button again)

2.) don't link with the WM2003 system settings but write an event for a
hardware-button by myself. Then the user could start the application once
and then trigger the application by pressing the specific button.
Problem:
- i don't know how to wait for a hardware-button

What can i do?

Boris
 
Use the approach you are currently using, but do make a console application.
Instead create a Windows app and make the main form invisible.
After your app is started, use RegisterHotKey to associate the hardware
button with the MessageWindow that you have created.
 
Use the approach you are currently using, but do make a console application.
Instead create a Windows app and make the main form invisible.
After your app is started, use RegisterHotKey to associate the hardware
button with the MessageWindow that you have created.

Thank you.
i'm not sure if i fully understand this - but i will try :)

Boris
 
Back
Top