GetIconWndClass()
得到的窗口类名:Afx:400000:b:10003:6:141ebb
并且每次都不一样。
\Microsoft Visual Studio 8\VC\atlmfc\src\mfc\winfrm.cpp
LPCTSTR CFrameWnd::GetIconWndClass(DWORD dwDefaultStyle, UINT nIDResource)
{ASSERT_VALID_IDR(nIDResource);
HINSTANCE hInst = AfxFindResourceHandle(
ATL_MAKEINTRESOURCE(nIDResource), ATL_RT_GROUP_ICON);
HICON hIcon = ::LoadIcon(hInst, ATL_MAKEINTRESOURCE(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
}
本文详细探讨了GetIconWndClass函数的使用,它返回的窗口类名如'Afx:400000:b:10003:6:141ebb',每次调用可能不同,主要涉及MFC框架和窗口样式。
3978

被折叠的 条评论
为什么被折叠?



