好吧,提出一个MFC的概念性问题
MFC(注一下吧,代码是看vs2010的...)
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) 函数的参数CREATESTRUCT,
参考源代码,实在传入函数LPCTSTR CFrameWnd::GetIconWndClass(DWORD dwDefaultStyle, UINT nIDResource)中新定义的,
那么cs中的参数cx,cy被改动后,怎么对实际的frame创建产生影响呢?
AfxCtxGetClassInfo(AfxGetInstanceHandle(), cs.lpszClass, &wndcls)
AfxRegisterWndClass(wndcls.style, wndcls.hCursor, wndcls.hbrBackground, hIcon);
貌似没有提到cx,cy的问题
下面是MFC的源代码。。。就是明确一下cx,cy被传到哪里去了,在哪里起作用。。。具体创建窗口的函数是什么,先谢了
LPCTSTR CFrameWnd::GetIconWndClass(DWORD dwDefaultStyle, UINT nIDResource){ ASSERT_VALID_IDR(nIDResource); HINSTANCE hInst = AfxFindResourceHandle( ATL_MAKEINTRESOURCE(nIDResource), ATL_RT_GROUP_ICON); HICON hIcon = ::LoadIconW(hInst, ATL_MAKEINTRESOURCEW(nIDResource)); if (hIcon != NULL) { CREATESTRUCT cs; memset(&cs, 0, sizeof(CREATESTRUCT)); cs.style = dwDefaultStyle; PreCreateWindow(cs); // will fill lpszClassName with default WNDCLASS name // ignore instance handle from PreCreateWindow. WNDCLASS wndcls; if (cs.lpszClass != NULL && AfxCtxGetClassInfo(AfxGetInstanceHandle(), cs.lpszClass, &wndcls) && wndcls.hIcon != hIcon) { // register a very similar WNDCLASS return AfxRegisterWndClass(wndcls.style, wndcls.hCursor, wndcls.hbrBackground, hIcon); } } return NULL; // just use the default}