|
이글을 보고 소스를 찾아봤는데.. 찾을수가 없네요..
NT계열은 그냥 ExitWindows로는 전원을 OFF 할수 없습니다.
누군가 이걸 물어보기에.. NT에서 전원OFF되는 소스를 만들어서..
보내준게 있었는데.. 아무리 찾아봐도 없습니다.
privileges 를 써야하는건 기억이나는데..
좀더 찾아보도록 하지요..
최준호.스페로 님이 쓰신 글 :
: 답변 정말로 감사합니다.
: 관심 가져 주셔서 감사합니다.
:
: ExitWindowsEx(EWX_FORCE , 0) ; //일단 실행중인 모든 프로그램을 종료
: //그래야 저장 메세지 등등을 무시하고 모두 닫아 버리고
:
: ExitWindowsEx(EWX_SHUTDOWN , 0) ; //컴퓨터 종료
:
: 이렇게 코딩을 했는데요
: 98에서는 문제 없이 전원이 OFF됩니다.
: 그런데 2000에서는 컴퓨터는 종료 되지 않고 다시 로그온 으로 갑니다... ㅠ.ㅠ
: 이걸 어찌 해결하지요
:
:
:
:
: 만해 님이 쓰신 글 :
: : 최준호.스페로 님이 쓰신 글 :
: : : 이함수를 이용하면 98에서는 컴퓨터를 끌수 있습니다.
: : : 윈도우2000 계열에서는 로그오프만 되거든요
: : :
: : : 윈도우2000에서 전원을 종료하는 방법을 아시는분 갈켜주세요
: :
: : 안녕하세요 만해입니다.
: :
: : ExitWindowsEx() 함수를 보면요
: :
: : 파라메타가 있는데요
: :
: : BOOL ExitWindowsEx(
: :
: : UINT uFlags, // shutdown operation
: : DWORD dwReserved // reserved
: : );
: :
: : 이렇게 되어 있고요
: :
: : uFlag에 따라서 작동이 틀려지짖요
: :
: :
: : EWX_FORCE
: : Forces processes to terminate. When this flag is set, Windows does not send the messages WM_QUERYENDSESSION and WM_ENDSESSION to the applications currently running in the system. This can cause the applications to lose data. Therefore, you should only use this flag in an emergency.
: :
: : 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. Windows 95: Security privileges are not supported or required.
: :
: : 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. Windows 95: Security privileges are not supported or required.
: :
: : 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. Windows 95: Security privileges are not supported or required.
: :
: : 위에 Win32 SDK의 헬프를 그대로 올렸거든요
: :
: : 참고 하세요
: :
: : 아마 제 생각엔 EWX_SHUTDOWN 이나 EWX_POWEROFF 이면 될것 같네요
: :
: : 그럼 이만~
|