• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 716
  • Last Modified:

I am trying to capture the WM_POWERBROADCAST in Windows XP

Any coding help with how to capture this message in XP?  I found an example in VB, but would like to know for sure it is possible outside the windows embedded environment.

Any help appreciated- thanks!
0
dmiorio
Asked:
dmiorio
1 Solution
 
jkrCommented:
Just like any other windows message:

LRESULT CALLBACK WindowProc(
  HWND hwnd,      // handle to window
  UINT uMsg,      // message identifier
  WPARAM wParam,  // first message parameter
  LPARAM lParam   // second message parameter
)
{
    switch(uMsg)
    {
        case WM_POWERBROADCAST:
           //... handle msg here

    }

    return DefWindowProc(hwnd,uMsg,wParam,lParam);
}


0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now