Hello, in delphi i use a component to see if windows wants to shutdown. can some one post how this goes in asm ? what kind of call i have to wait for and how can i stop this ? i like to wait for the windows shutdown and then i like to make a popup to ask if you realy want to shutdown or reboot the system :) thanks
Posted on 2001-03-13 09:11:00 by WH¥
Send me the component and I'll translate it for you...
Posted on 2001-03-13 09:40:00 by _Shawn
the message you have to wait for is WM_QUERYENDSESSION
Posted on 2001-03-13 09:43:00 by [SaFc0n]
Hello, thanks for the quick help :) many thanks for posting that you like to convert it for me ,but i like to make it by my own(just learning). the name of the call helps me a lot ! so im not shure if this is the right way,please correct me if im wrong. call WM_QueryEndSession (thats all ?) cmp eax, TRUE go and show message box... the message box to close realy: if user press yes: call WM_QueryEndSession,1 if user press no : call WM_QueryEndSession,0 looks a bit to easy for me,but i try it the next minutes ,hope i get no blue screen *bg* anyway thanks for taking the time to help :)
Posted on 2001-03-13 09:59:00 by WH¥
and I thought from reading your former post that you knew at least something about Window Proc.... I think you needx to create a window (or Dialog), an then wait for an WM_QUERYENDSESSION But I'm not to shure if this is right
Posted on 2001-03-13 12:14:00 by theNOP
Yes, it does have to be in a wndproc function. When ExitWindows() is called, the system sends WM_QUERYENDSESSION to all programs so they can do what they need. If for any reason, an application changes its value to 0, then no reboot or shutdown takes place. Now, there are different behaviors. If win95/98/me return true, the system will not do anything. On WinNT/2k, TRUE will the proceed to send WM_ENDSESSION and will indicate the system is shutting down. You can call AbortSystemShutDown() to abort the shutdown process. However, the shutdown must have been started with InitiateSystemShutDown(). ExitWindowsEx can shutdown, reboot, or logoff the user. There is a lot you can do with it. Look it up in the Platform SDK, there are examples demonstrating its use (not project samples). _Shawn
Posted on 2001-03-13 12:50:00 by _Shawn
Hello, thanks a lot ,now i understand :) hm,stupid idea i have to make a "call" for the function.... windows makes the call and i have to wait for it :) alltime i use menu buttons i "wait" for a call..like wm_exit i try to use my brain better *bg* hope this sounds not wrong,but its more easy than i think. in delphi a component and in asm some lines code. i like asm :) thank you !
Posted on 2001-03-13 14:25:00 by WH¥