请问用什么消息或什么函数来驱动屏保?

skzd 2000-09-08 01:49:00
...全文
111 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
关注
sean 2000-09-13
  • 打赏
  • 举报
回复
激活屏保是这样的,可是
如何在程序中关掉有密码保护的屏保呢?
Wingsun 2000-09-13
  • 打赏
  • 举报
回复
如下:
bool b;
if (! SystemParametersInfo(SPI_GETSCREENSAVEACTIVE,0,&b,0))
return;
if (!b)
return;
PostMessage(GetDesktopWindow(),WM_SYSCOMMAND,SC_SCREENSAVE,0);
playpcgame 2000-09-08
  • 打赏
  • 举报
回复
使用函数
ScreenSaverProc
DefScreenSaverProc

The following table describes how the DefScreenSaverProc processes a variety of window messages.

WM_ACTIVATE, WM_ACTIVATEAPP, WM_NCACTIVATE
Closes the screen saver if the wParam parameter is FALSE. A wParam value of FALSE indicates that the screen saver is losing the input focus. The screen saver is closed by sending aWM_CLOSE message.
WM_SETCURSOR
Removes the cursor from the screen by setting the cursor to NULL.
WM_LBUTTONDOWN, WM_RBUTTONDOWN, WM_MBUTTONDOWN,WM_KEYDOWN, WM_KEYUP, WM_MOUSEMOVE
Calls thePostQuitMessage function to close the screen saver.
WM_DESTROY
Posts a WM_CLOSE message to close the screen saver window.
WM_SYSCOMMAND
Returns FALSE if the wParam parameter of WM_SYSCOMMAND is either SC_CLOSE or SC_SCREENSAVE.

13,824

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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