CreateWindow
lpClassName[in] Pointer to a null-terminated string or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero. If lpClassName is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, provided that the module that registers the class is also the module that creates the window. The class name can also be any of the predefined system class names. For a list of system class names, see the Res section.
lpClassName[in] Pointer to a null-terminated string or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero. If lpClassName is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, provided that the module that registers the class is also the module that creates the window. The class name can also be any of the predefined system class names. For a list of system class names, see the Res section.
解决方案 »
- 求助,PreTranslatemessage,谁可以用sdk实现(模拟)?
- 如何用图片填充整个对话框,包括标题栏
- FilterASFWriter被编译时出现如下错误,改如何解决?
- 请高人指点.如何查看一个程序从运行到结束,吃掉多少物理内存?
- 在list control中插入中文项后 显示的是乱码
- 急!为什么在编译的时候总出现这样的错误!
- 怎样将编辑控件内输入的内容赋给一个变量??
- 怎样得到CDialogBar上的控件?如何响应放在CDialogBar上的控件的消息?应该在MainFrame里添代码,但我在OnCreate()中操作对象却还没生成
- 同志们,怎么不回答呀:敬请赐教socket问题!在线等待!加分100
- 如何将BYTE ID[2],赋值给UNS32 id;
- 怎样实现“中文系统下VC开发的软件可以在日文系统下正常运行”?
- 如何在调试时显示原始图像?
1、atom是16位的整数;
2、不是低字节、高字节,而是低字和高字。只有高字为0,才能和字符串指针区分开。
第二,lpClassName是一个指针,指针是32位的,而atom是16位的。综上,为了区别字符串和atom,所以M$的开发人员规定,如果你传入的指针高位为0,那说明它实际是一个atom,而不是一个指向一串以0结尾的字符。实际在使用资源时,这种约定在大量的使用。当然,由于某些原因,普通的字符串指针的高位是不会为0的。具体原因就留给楼下的高手来回答吧,嘿嘿
能不能举个用 atom 的例子 ?
===========================
没怎么用过。
msdn里函数一堆,
AddAtom
DeleteAtom
FindAtom
GlobalAddAtom
.
.
.
WNDCLASSEX wcex;wcex.cbSize = sizeof(WNDCLASSEX); wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 16;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(NULL, (LPCTSTR)IDI_WINLOGO);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = (LPCSTR)IDC_TEST;
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(NULL, (LPCTSTR)IDI_WINLOGO);rc=RegisterClassEx(&wcex);if(rc)
{
hFrame=CreateWindowEx(0, (LPCTSTR)rc, szWindowName, 1<<31, 0, 1<<31, 0,
(HWND)NULL, (HMENU)NULL, hInstance, 0L);
...
}