一个小问题

yx10 2003-10-22 08:27:29
请问在windows中调用哪个API函数可以实现关机的功能?
请讲详细点!谢谢!

...全文
85 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
leapmars 2003-10-22
  • 打赏
  • 举报
回复
BOOL ExitWindowsEx(
UINT uFlags, // shutdown operation
DWORD dwReserved // reserved
);

Parameters
uFlags

Specifies the type of shutdown. This parameter must include one of the following 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.

EWX_REBOOT: Shuts down the system and then restarts the system.

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.

dwReserved
Reserved; this parameter is ignored.


Return Values
If the function succeeds, the return value is nonzero.

yx10 2003-10-22
  • 打赏
  • 举报
回复
那要一些什么参数呢?
kk_ray 2003-10-22
  • 打赏
  • 举报
回复
ExitWindowsEx

1,184

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧