Program remains in memory after ShellExecute
Posted on 1998-07-01
My program launches the default Web browser and quits itself when the users press a button.
::ShellExecute(NULL, NULL, lpszUrl, NULL, NULL, SW_SHOWNORMAL);
this->PostMessage(WM_CLOSE); // I am using MFC, this is the frame window, the only window.
I tested it on Windows 95 with IE 4.01 sp1.
With the Browse in a new process setting of IE enabled:
If there is no IE browser running, pressing the button starts the browser, everything is fine. If there is an IE browser running, pressing the button switches to it with the specified URL, everything is fine except that my program remains in memory (it is there when I press Ctrl-Alt-Del) until I restart the system.
With the Browse in a new process setting of IE disabled:
My program remains in memory from the second time the button is pressed.
On Windows NT, the problem does not exist.
Any ideas how to solve this problem?