问个窗口类的问题
WNDCLASwndclass ;
wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc = WndProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hInstance ;
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground= (HBRUSH) GetStockObject (WHITE_BRUSH) ;
wndclass.lpszMenuNam= NULL ;
wndclass.lpszClassName= szAppName ;
为什么窗口类要包含注册该类的实例的句柄,一个程序注册的窗口类是不是只有该程序才能在CreateWindow函数中使用?
[解决办法]
是的,注册的窗口类只在本进程有效.
sign-----------------------------------
[解决办法]
是啊。。这是微软定的规则
[解决办法]
窗口类是与当前进程环境内的一个记录,只在本进程中有效,注册窗口类就是在进程中登记窗口类