//
#include "stdafx.h"
lresult callback wndproc(hwnd, uint, wparam, lparam);
//外部變數
extern winproc oldeditproc;
tchar szmyclass ="myedit";
int apientry winmain(hinstance hinstance,
hinstance hprevinstance,
lpstr lpcmdline,
int ncmdshow)
wndclass mywndclass;
getclassinfo(null, "edit", &mywndclass);
mywndclass.lpszclassname = szmyclass;
oldeditproc = (winproc)mywndclass.lpfnwndproc;
mywndclass.lpfnwndproc = subclasswinproc;
if (!registerclass(&mywndclass))
hwndmian=createwindow(szclassname,
"mywindows",
cw_usedefault,
cw_usedefault,
cw_usedefault,
cw_usedefault,
null,
null,
hinstance,
null
);if (hwndmian==null)
showwindow(hwndmian, ncmdshow);
updatewindow(hwndmian);
while(getmessage(&msg, null, null, null))
return msg.wparam;}/
lresult winapi wndproc(hwnd hwnd, uint message, wparam wparam, lparam lparam)
return defwindowproc (hwnd, message, wparam, lparam) ;
}///
https://p-blog.csdn.net/images/p_blog_csdn_net/vincent_1011/entryimages/20090707/超子類化.jpg
視窗的子類化與超類化
1.子類化 改變乙個已經存在的視窗例項的性質 訊息處理與其他例項屬性。在sdk程式設計範疇內,子類化就是改變乙個視窗例項的視窗函式 通過getwindowlong 和setwindowlong 子類化所要做的就是為某視窗例項編寫新的視窗函式。其操作是在例項級別上進行的。在mfc中子類化的情況有所不同...
視窗的子類化與超類化
視窗的子類化與超類化 1.子類化 改變乙個已經存在的視窗例項的性質 訊息處理與其他例項屬性。在sdk程式設計範疇內,子類化就是改變乙個視窗例項的視窗函式 通過getwindowlong 和setwindowlong 子類化所要做的就是為某視窗例項編寫新的視窗函式。其操作是在例項級別上進行的。在mfc...
視窗子類化與超類化
範疇上,可以認為子類化是 超類化的子集。下面分別給出原始碼 子類化 儲存視窗預設的訊息響應函式指標 wndproc psubclassoldeditproc 用於替換子類化視窗的訊息響應函式 lresult callback jceditprocsubclass hwnd hwnd,uint mes...