⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index146.htm

📁 一本不错的VC编程的参考书
💻 HTM
字号:
<html>
<style type="text/css"><!--
.p9 {  font-family: "宋体"; font-size: 9pt}a        {text-transform: none; text-decoration: none;}
a:hover {text-decoration: underline; color: #FF0000;}
--></style>
<body background="../di2001.jpg">
<h3 align="center"><font COLOR="#AOAO99"></font></h3>
<table width="100%" border="1" cellspacing="1">
<tr><td><p align="center"><font color="#FF0000">如何阻止WINDOWS关闭?</font></td></tr>
<tr><td><p>
</Br>
我有一个应用程序会不停地工作.当该程序正常运行时,该如何避免用户关掉系统?是不是该用WM_QUERYENDSESSION.<Br>
</Br>
是的,在你的主框架窗口类中使用.<Br>
</Br>
// in the class header<Br>
afx_msg BOOL OnQueryEndSession( WPARAM wReserved, LPARAM lEndReason );<Br>
</Br>
// in the Message Map<Br>
ON_MESSAGE( WM_QUERYENDSESSION, OnQueryEndSession )<Br>
</Br>
// in the class body<Br>
BOOL CMainFrame::OnQueryEndSession( WPARAM wReserved, LPARAM lEndReason )<Br>
{<Br>
&nbsp;&nbsp;&nbsp;&nbsp;if( lEndReason =3D=3D ENDSESSION_LOGOFF ) {<Br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// user is logging off<Br>
&nbsp;&nbsp;&nbsp;&nbsp;else<Br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Windows is going down<Br>
</Br>
&nbsp;&nbsp;&nbsp;&nbsp;return( bCanExit );<Br>
}<Br>
</Br>
</Br>
</p></td></tr>
</table>
</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -