So, a windows screensaver is just an exe that is passed one of 3 parameters.
/c for config screen
/s for fullscreen
/p <hwnd> for the little preview window.
I have everything working peachy except I have multiple processing running (this is the problem).
When you have the windows screensaver picker window open and select my screensaver, it launches it with /p so that it can show a preview. If you click the settings button, it will call my sreensaver again with /c. Now I there are two processing running. When I close the dialog, my process ends, but windows is now calling my screensaver again with /p . The processes keep adding up.
How should I handle this problem? I dont' see any documentation on the subject. I am hoping someone out there has done this before.
I don't want to monitor other processes to keep only one running. There has to be a solution I'm not seeing.
Thanks
After further investigation, I see that windows passes messages to your screensaver: http://msdn.microsoft.com/en-us/library/cc144066%28v=vs.85%29.aspx
I setup a filter to catch the messages. I am getting everything but destroy. LOL. I would assume that it would pass WM_DESTROY to tell you to bail.