Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!uwm.edu!zaphod.mps.ohio-state.edu!think!mintaka!ogicse!decwrl!nsc!balaji From: balaji@nsc.nsc.com (Balaji Pitchaikani) Newsgroups: comp.windows.ms Subject: Re: Closing Windows with no user interaction Message-ID: <13628@nsc.nsc.com> Date: 22 Feb 90 21:16:29 GMT References: <426@bjcong.bj.co.uk> Distribution: usa Organization: National Semiconductor, Santa Clara Lines: 41 Cc: balaji@nsc.nsc.com In article <426@bjcong.bj.co.uk> rkt@bjcong.bj.co.uk (RAKESH TANDON) writes: >I want to be able to exit out of windows from within my application. >I am aware of FindWindow, GetWindow, and GetNextWindow and posting/ >sending each window a WM_CLOSE (???) but the problem is when a >window queries the closedown ^^^^^^^^^^^^^^^^^^^^^ If I have understood correctly, You want to close YOUR APPLICATION without any queries from windows. This can be easily done by including WM_CLOSE as you have mentioned. The sample piece of code will be:- case WM_CLOSE : .... .... /* Getting Ready for Closing application*/ PostQuitMessage(0); break; The above code will close that window. If this code is available in the main window, this will close your application. I prefer a query to be included before closing (ie. before PostQuitMessage(0)). If you want your program to exit out of windows itself, You can try FatalExit(0). HAS ANYONE TRIED THIS? Is it common to use this function in a standard application. I have used this in our SQA testing version so that we can automate testing. >or if someting like write or notepad requires some kind of input >before closing. Can this be done ? I am not sure what you are trying to explain about write and notepad. > Rakesh Tandon. balaji (balaji@nsc.nsc.com)