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

📄 subject_23317.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:23317 发表者:luckyding 发表日期:2002-12-03 10:55:50
<br>主题:为什么我不能截获Alt-F4消息?
<br>内容:为什么我不能截获Alt-F4消息?
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:金鱼王 回复日期:2002-12-03 11:07:54
<br>内容:你应该拦截WM_CLOSE消息,在WM_CLOSE的处理过程OnClose()处理!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:披着鸽毛的鹰 回复日期:2002-12-03 11:53:20
<br>内容:Please use HOOK,ok?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:孟德II 回复日期:2002-12-03 19:18:04
<br>内容:这是由于 WINDOWS 使用了虚拟键码技术,按键消息被系统自动转化成其他消息。替代方法是处理 WM_CLOSE 消息,任何基于消息循环的WINDOWS 程序退出前都会处理这个消息,例如退出WORD前如果有未保存的文件,WORD会进行相应询问,这就是由于WORD处理了 WM_CLOSE消息。<BR>关于系统按键消息,下面是&lt;&lt;WINDOWS 程序设计&gt;&gt;的说法<BR>The "SYS" in WM_SYSKEYDOWN and WM_SYSKEYUP stands for "system" and refers to keystrokes that are more important to Windows than to Windows applications. The WM_SYSKEYDOWN and WM_SYSKEYUP messages are usually generated for keys typed in combination with the Alt key. These keystrokes invoke options on the program's menu or system menu, or they are used for system functions such as switching the active window (Alt-Tab or Alt-Esc) or for system menu accelerators (Alt in combination with a function key such as Alt-F4 to close an application). Programs usually ignore the WM_SYSKEYUP and WM_SYSKEYDOWN messages and pass them to DefWindowProc. Because Windows takes care of all the Alt-key logic, you really have no need to trap these messages. Your window procedure will eventually receive other messages concerning the result of these keystrokes (such as a menu selection). If you want to include code in your window procedure to trap the system keystroke messages (as we will do in the KEYVIEW1 and KEYVIEW2 programs shown later in this chapter), pass the messages to DefWindowProc after you process them so that Windows can still use them for their intended purposes. <BR><BR><BR>2002-12-4 7:57:48

⌨️ 快捷键说明

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