0

There's WM_ACTIVATEAPP message on "desktop Windows":

Sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated.

Is there anything similar on Windows Mobile? WM_ACTIVATE cannot be used, as my application has multiple windows.

I need WM_ACTIVATEAPP (or something similar), because I'd like to request/release some power-consuming resources (GPS, backlight etc) when app gets activated/deactivated.

binaryLV
  • 9,002
  • 2
  • 40
  • 42
  • This C or C++? If so, you could put that case statement in the message pump and see if it hits. I haven't used C/C++ on mobile in years, though. –  Nov 21 '11 at 02:19
  • C++. `WM_ACTIVATEAPP` is not defined. I tried catching 0x001C, but with no success. – binaryLV Nov 21 '11 at 09:08

1 Answers1

1

I think WM_ACTIVATEAPP is not supported on windows mobile. To detect when app is activated/deactivated you can capture WM_ACTIVATE message. As per MSDN documentation, hWndPrevious i.e. lParam will always be NULL when the window being activated and the window being deactivated are in separate processes. Following post makes use of same concept to address this issue. Hope this helps you. http://social.msdn.microsoft.com/forums/en-US/vssmartdevicesnative/thread/3fbe52b6-a895-4470-8cfe-c3d86a58fd73/

Nilesh
  • 5,955
  • 3
  • 24
  • 34
  • Using `WM_ACTIVATE` would force me to handle it in WndProc() of *every window* in my app, which is something I'd like to avoid. As for the C++ tag you added to the question - the question is not language-specific. – binaryLV Nov 22 '11 at 12:34