views:

370

answers:

0

I have a Windows CE application that is targeted at several (well two) different windows CE devices. The application is developed in Visual studio 2005 using C++ & MFC (no .NET). One of the devices signals system shutdown to running apps. by posting a custom message to the apps. main thread message queue using the PostThreadMessage() API call, at present the application intercepts and acts on this message from within an overridden CWinApp::PreTranslateMessage() method.

We have tried to shift all device/platform specific code in the application out to a hardware abstraction library, and I'd like to shift the shutdown message processing out to the library too.

On Desktop Windows I could use SetWindowsHookEx(WH_CALLWNDPROC ...) to hook the app. main thread processing, however on Windows CE/Mobile SetWindowsHookEx(CALLWNDPROC ...) is not supported. Hooking/"subclassing" the app. main window message processing with a SetWindowLong() call aint going to help me either as the message in question is not directed at any particular window.

Anyone got any other ideas??

Thanks

Richard.