Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!uw-june!roper From: roper@june.cs.washington.edu (Michael Roper) Newsgroups: comp.windows.ms Subject: Re: Closing Down MS_DOS Executive Message-ID: <7998@june.cs.washington.edu> Date: 25 Apr 89 23:02:23 GMT References: <2012@lznh.UUCP> Distribution: na Organization: U of Washington, Computer Science, Seattle Lines: 25 Lisa Krauth writes: > I got this solution from Microsoft Tech Support: > > PostMessage((HWND)0xffff, WM_SYSCOMMAND, SC_CLOSE, (LONG)0); As a postscript to my previous article on this approach, I'd like to add that no matter what it is you are trying to do, this is a very bad idea. Don't do it. If you don't care about the confirmation message box, just send the MS-DOS Executive this message exclusively. Broadcasting an SC_CLOSE message like this will almost certainly cause the debugging version of windows to crash if the user decides to cancel at confirmation time. The reason is that this message will close some windows you don't want closed if you're not really leaving Windows. You can get the window handle for the MS-DOS Executive with: hWnd = FindWindow( "Session", NULL ); This works even with foreign language versions of Windows. Mike Roper hDC Computer Corporation