上一篇Notepad++源码分析(二)提到过
::CallWindowProc(_tabBarDefaultProc, hwnd, Message, wParam, lParam);
这里的_tebBarDefaultProc的由来是用来保存原始Tabbar控件的消息处理函数.即:
::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
_tabBarDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(TabBar_Proc)));
说到这里更加令人感兴趣的东东来了,就是SetWindowLong,当然与之对应的就是GetWindowLong.这里用来设置和获取窗口类得参数,因此我们可以知道一个窗口类被定义好之后还是可以修改这个窗口类的.能够修改哪些东西,我把MSDN上的东东粘贴下来,一起分析看看吧
The SetWindowLong function changes an attribute of the specified window. The function also sets the 32-bit (long) value at the specified offset into the extra window memory.
Note This function has been superseded by the SetWindowLongPtr function. To write code that is compatible with both 32-bit and 64-bit versions of Microsoft Windows, use the Set