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

📄 class_csubclasswnd.html

📁 用VC實現截取Window的消息
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta name="robots" content="noindex"><title>CSubclassWnd Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body bgcolor="#ffffff"><!-- Generated by Doxygen 1.1.1 on Thu Jun 8 16:22:14 2000 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </center><hr><h1>CSubclassWnd  Class Reference</h1>Pluggable window message handler. <a href="#_details">More...</a><p><a href="class_csubclasswnd-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td colspan=4><br><h2>Public Methods</h2></td></tr><tr><td><img src="null.gif"></td><td><img src="null.gif"></td><td nowrap align=right valign=top>const MSG*&nbsp;</td><td valign=top><a class="el" href="class_csubclasswnd.html#a0">GetCurrentMessage</a> () const</td></tr><tr><td><img src=null.gif></td><td><img src=null.gif></td><td></td><td><font size=-1><em>Retrieves a pointer to the "current" MSG structure being handled.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr><p><tr><td><img src="null.gif"></td><td><img src="null.gif"></td><td nowrap align=right valign=top>HWND&nbsp;</td><td valign=top><a class="el" href="class_csubclasswnd.html#a1">GetHandle</a> () const</td></tr><tr><td><img src=null.gif></td><td><img src=null.gif></td><td></td><td><font size=-1><em>Called to get the handle of the subclassed window.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr><p><tr><td><img src="null.gif"></td><td><img src="null.gif"></td><td nowrap align=right valign=top>LRESULT&nbsp;</td><td valign=top><a class="el" href="class_csubclasswnd.html#a2">SendMessage</a> (UINT message, WPARAM wParam=0, LPARAM lParam=0)</td></tr><tr><td><img src=null.gif></td><td><img src=null.gif></td><td></td><td><font size=-1><em>Sends a message to the subclassed window.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr><p><tr><td><img src="null.gif"></td><td><img src="null.gif"></td><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=top><a class="el" href="class_csubclasswnd.html#a3">PostMessage</a> (UINT message, WPARAM wParam=0, LPARAM lParam=0)</td></tr><tr><td><img src=null.gif></td><td><img src=null.gif></td><td></td><td><font size=-1><em>Posts a message to the subclassed window.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr><p><tr><td><img src="null.gif"></td><td><img src="null.gif"></td><td nowrap align=right valign=top>void&nbsp;</td><td valign=top><a class="el" href="class_csubclasswnd.html#a4">SendMessageToDescendants</a> (UINT message, WPARAM wParam, LPARAM lParam, BOOL bDeep=TRUE)</td></tr><tr><td><img src=null.gif></td><td><img src=null.gif></td><td></td><td><font size=-1><em>Sends a message to all child windows of the subclassed window.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr><p><tr><td colspan=4><br><h2>Protected Methods</h2></td></tr><tr><td><img src="null.gif"></td><td><img src="null.gif"></td><td nowrap align=right valign=top><a name="b0" doxytag="CSubclassWnd::CSubclassWnd">&nbsp;</td><td valign=top><a class="el" href="class_csubclasswnd.html#b0">CSubclassWnd</a> ()</a></td></tr><tr><td><img src=null.gif></td><td><img src=null.gif></td><td></td><td><font size=-1><em>Default contructor.</em></font><br><br></td></tr><p><tr><td><img src="null.gif"></td><td><img src="null.gif"></td><td nowrap align=right valign=top><a name="b1" doxytag="CSubclassWnd::~CSubclassWnd">virtual&nbsp;</td><td valign=top><a class="el" href="class_csubclasswnd.html#b1">~CSubclassWnd</a> ()</a></td></tr><tr><td><img src=null.gif></td><td><img src=null.gif></td><td></td><td><font size=-1><em>Destructor.</em></font><br><br></td></tr><p><tr><td><img src="null.gif"></td><td><img src="null.gif"></td><td nowrap align=right valign=top>virtual BOOL&nbsp;</td><td valign=top><a class="el" href="class_csubclasswnd.html#b2">ProcessWindowMessage</a> (UINT message, WPARAM wParam, LPARAM lParam, LRESULT&amp; lResult)</td></tr><tr><td><img src=null.gif></td><td><img src=null.gif></td><td></td><td><font size=-1><em>Called to handle window messages.</em> <a href="#b2">More...</a><em></em></font><br><br></td></tr><p><tr><td><img src="null.gif"></td><td><img src="null.gif"></td><td nowrap align=right valign=top><a name="b3" doxytag="CSubclassWnd::OnFinalMessage">virtual void&nbsp;</td><td valign=top><a class="el" href="class_csubclasswnd.html#b3">OnFinalMessage</a> ()</a></td></tr><tr><td><img src=null.gif></td><td><img src=null.gif></td><td></td><td><font size=-1><em>Called after the last message has been dispatched to the window.</em></font><br><br></td></tr><p><tr><td><img src="null.gif"></td><td><img src="null.gif"></td><td nowrap align=right valign=top>LRESULT&nbsp;</td><td valign=top><a class="el" href="class_csubclasswnd.html#b4">DefWindowProc</a> ()</td></tr><tr><td><img src=null.gif></td><td><img src=null.gif></td><td></td><td><font size=-1><em>Calls the "default" window procedure with the current message.</em> <a href="#b4">More...</a><em></em></font><br><br></td></tr><p><tr><td><img src="null.gif"></td><td><img src="null.gif"></td><td nowrap align=right valign=top>LRESULT&nbsp;</td><td valign=top><a class="el" href="class_csubclasswnd.html#b5">DefWindowProc</a> (UINT message, WPARAM wParam, LPARAM lParam)</td></tr><tr><td><img src=null.gif></td><td><img src=null.gif></td><td></td><td><font size=-1><em>Calls the "default" window procedure with the specified message.</em> <a href="#b5">More...</a><em></em></font><br><br></td></tr><p><tr><td><img src="null.gif"></td><td><img src="null.gif"></td><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=top><a class="el" href="class_csubclasswnd.html#b6">SubclassWindow</a> (HWND hWnd, BOOL bReflect=TRUE)</td></tr><tr><td><img src=null.gif></td><td><img src=null.gif></td><td></td><td><font size=-1><em>Called to subclass the specified window.</em> <a href="#b6">More...</a><em></em></font><br><br></td></tr><p><tr><td><img src="null.gif"></td><td><img src="null.gif"></td><td nowrap align=right valign=top>HWND&nbsp;</td><td valign=top><a class="el" href="class_csubclasswnd.html#b7">UnsubclassWindow</a> ()</td></tr><tr><td><img src=null.gif></td><td><img src=null.gif></td><td></td><td><font size=-1><em>Called to unsubclass the specified window.</em> <a href="#b7">More...</a><em></em></font><br><br></td></tr><p></table><hr><a name="_details"></a><h2>Detailed Description</h2>Pluggable window message handler.<p>This class can be used to "subclass" a window in the C API sense of the term. It is a base class, meant to be derived from. Derived classes should provide an interface that will call <a class="el" href="class_csubclasswnd.html#b6">CSubclassWnd::SubclassWindow</a>() in order to hook into a window's message handling interface. Typically this will be done in the derived's constructor and the OnFinalMessage method will be overriden to delete the object's instance (delete this).<p><hr><h2>Member Function Documentation</h2><a name="b5" doxytag="CSubclassWnd::DefWindowProc"><p><table width=100%% cellpadding=2 cellspacing=0 border=0><tr><td class="md"><b>LRESULT CSubclassWnd::DefWindowProc (UINT <em>message</em>, WPARAM <em>wParam</em>, LPARAM <em>lParam</em>)<code> [inline, protected]</code></b></td></tr></table></a><div class="in"><p>Calls the "default" window procedure with the specified message.<p>The "default" procedure is what ever procedure was subclassed by this class.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>message</em>&nbsp;</td><td> [in] Specifies the message id. </td></tr><tr><td valign=top><em>wParam</em>&nbsp;</td><td> [in] Specifies additional message-specific information. </td></tr><tr><td valign=top><em>lParam</em>&nbsp;</td><td> [in] Specifies additional message-specific information.<p></td></tr></table></dl><dl compact><dt><b>Returns: </b><dd> The return value is the result of the message processing and depends on the message.</dl></div><a name="b4" doxytag="CSubclassWnd::DefWindowProc"><p><table width=100%% cellpadding=2 cellspacing=0 border=0><tr><td class="md"><b>LRESULT CSubclassWnd::DefWindowProc ()<code> [inline, protected]</code></b></td></tr></table></a><div class="in"><p>Calls the "default" window procedure with the current message.<p>The "default" procedure is what ever procedure was subclassed by this class.<p><dl compact><dt><b>Returns: </b><dd> The return value is the result of the message processing and depends on the message.</dl></div><a name="a0" doxytag="CSubclassWnd::GetCurrentMessage"><p><table width=100%% cellpadding=2 cellspacing=0 border=0><tr><td class="md"><b>const MSG * CSubclassWnd::GetCurrentMessage () const<code> [inline]</code></b></td></tr></table></a><div class="in"><p>Retrieves a pointer to the "current" MSG structure being handled.<p><dl compact><dt><b>Returns: </b><dd> Returns a pointer to the "current" MSG structure being handled.</dl></div><a name="a1" doxytag="CSubclassWnd::GetHandle"><p><table width=100%% cellpadding=2 cellspacing=0 border=0><tr><td class="md"><b>HWND CSubclassWnd::GetHandle () const<code> [inline]</code></b></td></tr></table></a><div class="in"><p>Called to get the handle of the subclassed window.<p><dl compact><dt><b>Returns: </b><dd> The handle to the currently subclassed window.</dl></div><a name="a3" doxytag="CSubclassWnd::PostMessage"><p><table width=100%% cellpadding=2 cellspacing=0 border=0><tr><td class="md"><b>BOOL CSubclassWnd::PostMessage (UINT <em>message</em>, WPARAM <em>wParam</em> = 0, LPARAM <em>lParam</em> = 0)<code> [inline]</code></b></td></tr></table></a><div class="in"><p>Posts a message to the subclassed window.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>message</em>

⌨️ 快捷键说明

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