1.如何激活当前屏幕保护程序
// 激活当前屏幕保护程序, jingzhou xu
PostMessage(WM_SYSCOMMAND,SC_SCREENSAVE,0); |
2.如何禁止/启用屏幕保护及电源管理
static UINT dss_GetList[] = {SPI_GETLOWPOWERTIMEOUT, SPI_GETPOWEROFFTIMEOUT,
SPI_GETSCREENSAVETIMEOUT};
static UINT dss_SetList[] = {SPI_SETLOWPOWERTIMEOUT, SPI_SETPOWEROFFTIMEOUT,
SPI_SETSCREENSAVETIMEOUT};
static const int dss_ListCount = _countof(dss_GetList);
{
m_pValue = new int[dss_ListCount];
for (int x=0;x |
3.如何激活和关闭IE浏览器
//激活并打开IE
void lounchIE()
{
HWND h=FindWindowEx(NULL,NULL,NULL,
"Microsoft Internet Explorer") ;
ShellExecute(h,"open","C:\\simple.html",
NULL,NULL,SW_SHOWNORMAL);
}
//关闭IE及其它应用
void CloseIE()
{
int app=BSM_APPLICATIONS;
unsigned long bsm_app=(unsigned long )app;
BroadcastSystemMessage(BSF_POSTMESSAGE,&bsm_app,
WM_CLOSE,NULL,NULL);
} |
阅读(750) | 评论(0) | 转发(0) |