GetIconWndClass注册窗口类
2015-11-03 14:30
609 查看
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
}
得到的窗口类名: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
}
相关文章推荐
- 【Android开发精要笔记】Android的Intent机制
- [选择语句好看但是快吗?]Length of Last Word
- 人的格局与人的底线
- hdu 1874 畅通工程续(最短路Dij邻接矩阵)
- 杭电1088&zoj1099 Write a simple HTML Browser
- PreferencesFragment
- java实现图片裁切的工具类实例
- 熊孩子为什么叫我们阿姨/叔叔?
- ncurse
- iOS开发技巧:使用Xcode DEBUG模式和RELEASE模式
- 简单明了介绍Spring手工注入@autowire用法 及 beans.xml配置区别
- 并查集详解 (转)
- iOS9下App Store新应用提审攻略
- 5方与5W
- java并发编程(synchronized同步和Lock显示锁)
- bcb NumberUpDown 设置
- 图像处理质量评价标准之PSNR
- 3.6
- CoreGraphics QuartzCore CGContextTranslateCTM 用法
- 用qt编译Android应用(windows和Linux)