小妹初入江湖,还请各位指教。
问题如下:我想用BOOL ExitWindowsEx(UINT uFlags, // shutdown operation
DWORD dwReserved // reserved);
函数来实现定时关机,在98下可实现,程序如下:
void LB_Exit
{
::ExitWindowsEx(EWX_POWEROFF,0);
}
但是在2000下却不行,经查阅MSDN,原文如下:
Windows NT/2000: To shut down or restart the system, the calling process must use the AdjustTokenPrivileges function to enable the SE_SHUTDOWN_NAME privilege. For more information about security privileges, see Privileges.
如何使用AdjustTokenPrivileges函数,使其发生作用,请各位高手指点迷津,最好给出相关程序,急等使用!!谢谢!!