Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "ExitWindows" in [All]

user32

.

    WINSTA_EXITWINDOWS      = 0x0040,

.

                    WINSTA_EXITWINDOWS | WINSTA_ENUMERATE | WINSTA_READSCREEN |

.
Summary
.

static extern bool ExitWindowsEx(ExitWindows uFlags, ShutdownReason dwReason);

.

static extern bool ExitWindowsEx(uint uFlags, uint dwReason);

.

Shared Function ExitWindowsEx( _

.

     ByVal uFlags As ExitWindows, _

.

Declare Function ExitWindowsEx Lib "user32" (ByVal dwOptions As Int32, ByVal dwReserved As Int32) As Int32

.
  • uFlags - See ExitWindows
.

If uFlags is set to 'LogOff', then the call will fail if the process calling it is a non-interactive-process (i.e a Windows Service). Read the [ExitWindowsEx] on MSDN for more info. All other values for uFlags work fine for non-interactive-processes.

.

        static extern bool ExitWindowsEx(uint uFlags, uint dwReason);

.

            ExitWindowsEx(ExitWindows.LogOff, ShutdownReason.MajorOther | ShutdownReason.MinorOther);

.
Documentation
[ExitWindowsEx] on MSDN

advapi32

.

    'which is necessary if you want to call ExitWindowsEx.

Enums

.

    WINSTA_EXITWINDOWS = 0x00000040,

.

    WINSTA_EXITWINDOWS = &H40

.
Summary
Defines the Shutdown type for the user32.ExitWindowsEx method
.

public enum ExitWindows : uint

.

Enum ExitWindows As UInteger

.
Documentation
[ExitWindows] on MSDN
.
Summary
Defines the Shutdown reason for the user32.ExitWindowsEx method

kernel32

.

Note that for an application to be restarted when the update requires a computer restart, the installer must call the ExitWindowsEx function with the EWX_RESTARTAPPS flag set or the InitiateShutdown function with the SHUTDOWN_RESTARTAPPS flag set.

aygshell

. .

static extern bool ExitWindowsEx([MarshalAs(UnmanagedType.U4)]uint dwFlags, [MarshalAs(UnmanagedType.U4)]uint dwReserved);

.

static extern bool ExitWindowsEx([MarshalAs(UnmanagedType.U4)] ExitWindowsAction uFlags, [MarshalAs(UnmanagedType.U4)] uint dwReserved);

.

Declare Function ExitWindowsEx Lib "aygshell.dll" (ByVal dwFlags As Integer, ByVal dwReserved As Integer) As Boolean

.

enum ExitWindowsAction : uint

.

Available only at Windows Mobile 5.0 or later. The ExitWindowsEx function returns as soon as it has initiated the shutdown. The shutdown then proceeds asynchronously. Because the function executes asynchronously, a nonzero return value indicates that the shutdown has been initiated. It does not indicate whether the shutdown will succeed. It is possible that the system, the user, or another application will abort the shutdown.

.

    ExitWindowsEx(ExitWindowsAction.EWX_REBOOT, 0);

.
Documentation
[ExitWindowsEx] on MSDN

 
Access PInvoke.net directly from VS: