Hi

It's been 2 years since I last did any programming or contributed to this forum I'm back with a question I hope someone can help me with.

I have an app written in MFC which can be run by multiple users logged into XP. I need to add some event handling so that when one user switches to another, the app is effectively "paused" for the user until their account is switched back to.

I can handle the "pause" part, I just need to know how my app can know that the account under which it is running is not the active desktop account.

I've found this :

WTSRegisterSessionNotification(hWnd, NOTIFY_FOR_THIS_SESSION);

which appears to be a terminal server sdk function which will cause the message WM_WTSSESSION_CHANGE to be sent as a callback to the window with the hWnd specified above. All well and good, and probably just the ticket. Problem is, it requires _WIN32_WINNT 0x0501 to compile, and my app is set to 0x0400 because it is to run on 98 and 2k also.

So, I need some other way to detect user switching in an MFC app, that will compile on an xp system in vs2003, but will still run on a 98/2k system.

Thanks a lot for your suggestions.