调用CreateWindow函数时会发送WM_CREATE信息吗?
调用CreateWindow函数时会向WinProc函数发送WM_CREATE信息吗?我在WinPro函数里加了一条MessageBox()函数发现没有发送WM_CREA...
调用CreateWindow函数时会向WinProc函数发送WM_CREATE信息吗?我在WinPro函数里加了一条MessageBox()函数发现没有发送WM_CREATE信息。
#ifndef HINST_THISCOMPONENT
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
#define HINST_THISCOMPONENT ((HINSTANCE)&__ImageBase)
#endif
WNDCLASSEX wcex;
wcex.cbSize=sizeof(WNDCLASSEX);
wcex.cbWndExtra=sizeof(LONG_PTR);
wcex.cbClsExtra=0;
wcex.hbrBackground=NULL;
wcex.hCursor=LoadCursor(NULL,IDC_ARROW);
wcex.hIcon=NULL;
wcex.hIconSm=NULL;
wcex.hInstance=HINST_THISCOMPONENT;
wcex.lpfnWndProc=D2Dapp::WinProc;
wcex.lpszClassName=L"D2Dapp";
wcex.lpszMenuName=NULL;
wcex.style=CS_HREDRAW | CS_VREDRAW;
RegisterClassEx(&wcex);
FLOAT dpiX,dpiY;
pD2DFactory->GetDesktopDpi(&dpiX,&dpiY);
hwnd=CreateWindow(
wcex.lpszClassName,
L"Main Window",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
static_cast<UINT>(ceil(640.f*dpiX/96.f)),
static_cast<UINT>(ceil(480.f*dpiY/96.f)),
NULL,
NULL,
HINST_THISCOMPONENT,
this); 展开
#ifndef HINST_THISCOMPONENT
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
#define HINST_THISCOMPONENT ((HINSTANCE)&__ImageBase)
#endif
WNDCLASSEX wcex;
wcex.cbSize=sizeof(WNDCLASSEX);
wcex.cbWndExtra=sizeof(LONG_PTR);
wcex.cbClsExtra=0;
wcex.hbrBackground=NULL;
wcex.hCursor=LoadCursor(NULL,IDC_ARROW);
wcex.hIcon=NULL;
wcex.hIconSm=NULL;
wcex.hInstance=HINST_THISCOMPONENT;
wcex.lpfnWndProc=D2Dapp::WinProc;
wcex.lpszClassName=L"D2Dapp";
wcex.lpszMenuName=NULL;
wcex.style=CS_HREDRAW | CS_VREDRAW;
RegisterClassEx(&wcex);
FLOAT dpiX,dpiY;
pD2DFactory->GetDesktopDpi(&dpiX,&dpiY);
hwnd=CreateWindow(
wcex.lpszClassName,
L"Main Window",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
static_cast<UINT>(ceil(640.f*dpiX/96.f)),
static_cast<UINT>(ceil(480.f*dpiY/96.f)),
NULL,
NULL,
HINST_THISCOMPONENT,
this); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询