>>>> Can anyone tell me the way to shut down window98 on quiting foxpro program? I am using Visual foxpro 6.0.
>>>
>>>Use
>>>
>>>RUN RUNDLL32.EXE user.exe,exitwindows
>>
>>A better way is to use the ExitWindowsEx() API call; it's documented in the FAQ and the Windows API section.
>
>How can API call exit Windows better than a RUN command?
You have more available options through ExitWindowsEx() (the code you give forces a powerdown if APPC is enabled), it doesn't pop up a DOS box, you don't rely on having an intact Windows search path, and it works on other platforms, defaulting the behavior to logging out the current user if the user does have adequate privileges to force a restart of Windows. The code you list doesn't work under Win2K, for example. YMMV.