Function Long ExitWindowsEx(Long uflag, Long nouse) Library "user32.dll”
我知道是调用这个函数 但是我不知道是怎么用
我是初学者 麻烦讲详细点 或者加我Q369143808 指教一下
------解决方案--------------------
Function Long ExitWindowsEx(Long uflag, Long nouse) Library "user32.dll”
参数2保留不用,可取0;参数1取0可以注销当前用户,取1可以关闭计算机,取2
可以重启计算机,其值再加4表示强制结束“未响应”的进程。
------解决方案--------------------
1.先声明函数:global external functions里写:
Function Long ExitWindowsEx(Long uflag, Long nouse) Library "user32.dll”
2.你在需要自动关机的地方调用这个函数就行!
ExitWindowsEx(1,0)
------解决方案--------------------
//local external functions下声明
FUNCTION ulong ExitWindowsEx(ulong uFlags,ulong dwReserved) LIBRARY "user32.dll"
//调用方法
ExitWindowsEx(1,0)//正常关闭
参照1楼
------解决方案--------------------
------解决方案--------------------
还有一种方法,就是用run()函数调用shutdown