>> The MSDN documentation on ExitWindowsEx is pretty explicit;
>> read the entry on Windows 95 immediately before the QuickInfo
>> section of the documentation.
>
>Quote:
>"Windows 95: ExitWindowEx does not work from a console application,
>as it does on Windows NT."
>
>I couldn't quite understand that line. Is it saying
>that I need an un-documented way to use the ExitWindowsEx()
>function?
No, it means that console apps without a GUI behave differently under Win95 and WinNT with respect to the API call.
>
>How is the shutdown option in StartMenu working then?
A console app is not a necessarily a part of the Windows Shell (the shutdown option in StartMenu actually does use the ExitWindowsEx API call, with a dialog intervening to set parameters.) What the reference in the API doc implies is that there are differences between standard WinApps and services, and between console-based apps and GUI-based apps in what exactly occurs when the API call is used. In addition, the API call behaves differently under NT and Win9x, due mostly to differences in user capabilities and permissions. I'd suggest reading Jeff Richter's
Advanced Windows, the section
Writing Your First Win32 Application discusses differences between console-based and GUI apps in a couple of pages very well. Beyond that, the canonical reference is
Microsoft Win32 Programmer's Guide, and another excellent reference is Walter Oney's
Systems Programming for Windows 95.