>>Hi,
>> I used to do so before using the following parameter:
>>#DEFINE EWX_LOGOFF 0
>>#DEFINE EWX_SHUTDOWN 1
>>#DEFINE EWX_REBOOT 2
>>#DEFINE EWX_FORCE 4
>>#DEFINE EWX_POWEROFF 8
>>
>>ExitWindowsEx(EWX_SHUTDOWN, 0)
>>
>>it do shutdown. !!!! However, if there are many running application while u issue ExitWindowsEx() it won shutdown ... (sometime) but it working last time in Win95..try it out.....!!!! if u can solve my problem please told me ...
>
>
>Thanks All, It work now!
>
>ExitWindowsEx(EWX_SHUTDOWN+EWX_FORCE, 0)
>
>just like another API examples on Close application:
>
>#Define WM_DESTROY 0x0002
>#Define WM_CLOSE 0x0010
>DECLARE INTEGER SendMessage IN Win32API;
> INTEGER hwnd, INTEGER uMsg,;
> INTEGER wParam, INTEGER lParam
>* Close and Allow Prompt Save changes
>= SendMessage(lnhwnd, WM_CLOSE, 0, 0)
>* Close without allowing Prompt
>= SendMessage(lnhwnd, WM_DESTROY, 0, 0)
>
>
>
>But I would ask UT might update the knowledge on that Exit Window Passage,
>as I got wrong information on usage at ExitWindowsEx() from that passage!!
>
>Since my company has change all PC to Win95 OSR2 2.5c Version with Novell 3.12
>then upgrade to Novell 4.1, I wonder it lose logout singal on shutdown PC..
>So, I need to write a short program to call "Logout" backgroundly and then Shutdown the PC! Finally, all work well ^_^;
>
>The last thing need to mention is when the written VFP prg to shutdown window
>Quit at once if possible after call the ExitWindowsEx(EWX_SHUTDOWN, 0)
>as I wonder the foxuser.dbf may corrupt at that time if still work sth else...
You need to realize that using EWX_FORCE is about the best method to guarentee data loss on a system, since any process that does not terminate in response to the standard Windows shutdown message within a period of time gets killed by TerminateProcess(), and the user will not be given a chance to abort the shutdown. If you're worried about FOXUSER.DBF, make certain that you've closed it (SET RESOURCE OFF. followed by FLUSH) well before issuing the ExitWindowsEx() call.