- CVI 정보나눔(www.cvi.kr)
- 스터디
- 질문답변
질문,답변
글 수 1,629
출장 중이라 자세히 설명드리기가 어렵네요.
Windows API함수 중에 ExitWindowsEx()가 있네요.
Import Library는 user32.lib 이구요,
함수에 대한 설명은 MSDN 도움말에 잘 나와 있는데, 아래에 퍼놓았습니다.
Windows API 함수 사용에 대해서는 강좌 10을 참고하세요.
--------------------------------------------------------
ExitWindowsEx
The ExitWindowsEx function either logs off the current user, shuts down the system, or shuts down and restarts the system. It sends the WM_QUERYENDSESSION message to all applications to determine if they can be terminated.
BOOL ExitWindowsEx(
UINT uFlags, // shutdown operation
DWORD dwReserved // reserved
);
Parameters
uFlags
Specifies the type of shutdown. This parameter must include one of the following values:
Value Meaning
EWX_LOGOFF Shuts down all processes running in the security context of the process that called the ExitWindowsEx function. Then it logs the user off.
EWX_POWEROFF Shuts down the system and turns off the power. The system must support the power-off feature.
Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.
EWX_REBOOT Shuts down the system and then restarts the system.
Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.
EWX_SHUTDOWN Shuts down the system to a point at which it is safe to turn off the power. All file buffers have been flushed to disk, and all running processes have stopped.
Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.
This parameter can optionally include the following values:
Value Meaning
EWX_FORCE Forces processes to terminate. When this flag is set, the system does not send the WM_QUERYENDSESSION and WM_ENDSESSION messages. This can cause the applications to lose data. Therefore, you should only use this flag in an emergency.
EWX_FORCEIFHUNG Windows NT 5.0 and later: Forces processes to terminate if they do not respond to the WM_QUERYENDSESSION or WM_ENDSESSION message. This flag is ignored if EWX_FORCE is used.
dwReserved
Reserved; this parameter is ignored.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, callGetLastError.
Windows API함수 중에 ExitWindowsEx()가 있네요.
Import Library는 user32.lib 이구요,
함수에 대한 설명은 MSDN 도움말에 잘 나와 있는데, 아래에 퍼놓았습니다.
Windows API 함수 사용에 대해서는 강좌 10을 참고하세요.
--------------------------------------------------------
ExitWindowsEx
The ExitWindowsEx function either logs off the current user, shuts down the system, or shuts down and restarts the system. It sends the WM_QUERYENDSESSION message to all applications to determine if they can be terminated.
BOOL ExitWindowsEx(
UINT uFlags, // shutdown operation
DWORD dwReserved // reserved
);
Parameters
uFlags
Specifies the type of shutdown. This parameter must include one of the following values:
Value Meaning
EWX_LOGOFF Shuts down all processes running in the security context of the process that called the ExitWindowsEx function. Then it logs the user off.
EWX_POWEROFF Shuts down the system and turns off the power. The system must support the power-off feature.
Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.
EWX_REBOOT Shuts down the system and then restarts the system.
Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.
EWX_SHUTDOWN Shuts down the system to a point at which it is safe to turn off the power. All file buffers have been flushed to disk, and all running processes have stopped.
Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.
This parameter can optionally include the following values:
Value Meaning
EWX_FORCE Forces processes to terminate. When this flag is set, the system does not send the WM_QUERYENDSESSION and WM_ENDSESSION messages. This can cause the applications to lose data. Therefore, you should only use this flag in an emergency.
EWX_FORCEIFHUNG Windows NT 5.0 and later: Forces processes to terminate if they do not respond to the WM_QUERYENDSESSION or WM_ENDSESSION message. This flag is ignored if EWX_FORCE is used.
dwReserved
Reserved; this parameter is ignored.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, callGetLastError.
전 이렇게 강제 종료를 시켰습니다. 운용체제에 무리를 주는지 알수가 없지만, 잘 실행 되더라고요^^;;