Power key function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GD666
    New Member
    • Jan 2008
    • 1

    Power key function

    Hello,

    I'm developing a device application using the C# on .NET 2005. I'm developing this application for HP iPAQ rx5915 device. My question is that I want to show a message before clicking the POWER KEY. How can i do that?

    Best Regards
  • markmcgookin
    Recognized Expert Contributor
    • Dec 2006
    • 648

    #2
    Originally posted by goddamn666
    Hello,

    I'm developing a device application using the C# on .NET 2005. I'm developing this application for HP iPAQ rx5915 device. My question is that I want to show a message before clicking the POWER KEY. How can i do that?

    Best Regards
    This is very tricky as it doesn't exist in the Windows.Forms.K eys library. I assume you would need some sort of device specific API to tackle that problem. Or there may be some form of Device Power down/shutdown event to catch, but I feel that might be quite tricky as it will probably dispose of your app.

    Comment

    • RedSon
      Recognized Expert Expert
      • Jan 2007
      • 4980

      #3
      Originally posted by markmcgookin
      This is very tricky as it doesn't exist in the Windows.Forms.K eys library. I assume you would need some sort of device specific API to tackle that problem. Or there may be some form of Device Power down/shutdown event to catch, but I feel that might be quite tricky as it will probably dispose of your app.
      You should be able to subscribe to power manager events. When the system goes into shutdown or suspended mode you will get a message. You can also check the OEM specific keys to see if any of them fire when you press the power button. There won't be any thing obvious like OEM_PWR but OEMs usually map their special keys to OEM_* keys.

      Comment

      Working...