Article ID: 110254
Article Last Modified on 3/3/2005
*** Begin Code ***
* WARNING: Make sure all work is saved before running code
SET LIBRARY TO SYS(2004)+"FOXTOOLS.FLL" ADDITIVE
do_over=REGFN("ExitWindows","II","I")
title="Program Message"
msg="Would you like to restart Windows now?"
choice=MSGBOX(msg,title,36)
IF choice=6 && button 'Yes' was chosen
=CALLFN(do_over,66,0)
ELSE
WAIT WINDOW "You have chosen not to restart Windows" TIMEOUT 2
ENDIF
*** End Code ***
The ExitWindows() function requires two numeric values to be passed in and returns a single integer. The significance of the first integer (66) is that it is the decimal equivalent of 0x42 hexadecimal or EW_RESTARTWINDOWS, which is a low-order word in the C++ language. The second integer is reserved and is always zero. When the ExitWindows() function is called, it sends a message to all active applications that a request has been made to restart Windows. If all applications "agree" to be terminated, the WM_ENDSESSION message will be sent to all applications before Windows is restarted.
Additional query words: VFoxWin FoxWin 2.50 quit restart exit 3.00 2.50a
Keywords: kbinfo kbcode KB110254