Lennie De Villiers wrote: > Hi, > > How can I know if MS Windows is shutting down / restarting and delay the > process? > > I’m busy with an application where the user must book-in always before > shutting down the computer for the day. So the process is: If MS Windows is > shutting down/restart my application must come up asking for the user to > book-in first, after book-in the shut down process can continue. > > I’m looking for a solution that will work with all versions of MS Windows > (2000/NT/XP) > > Using Delphi 6 EE > > Kind Regards, > Lennie De Villiers
Windows broadcasts a message (WM_QUERYENDSESSION) to all top-level windows when a shutdown begins. ExitWindowsEx() initiates the shutdown. Because the message is broadcast using SendMessage(), you can suspend the shutdown process until the user finishes interacting with your application by manually pumping window messages. When the user is done, exit the manual message pump and return TRUE to the caller to let the shutdown continue. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 VerifyMyPC v1.0: "A stable PC is a happy PC." Learn more, take the tour, and download: http://www.CubicleSoft.com/VerifyMyPC/ ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/delphi-en/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

