5

大神,CreateWindowExW函数该怎么写?

#include
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{
WNDCLASS wndclass;
HWND hWnd;
MSG msg;
wndclass.style=CS_HREDRAW|CS_VREDRAW;
wndclass.lpfnWndProc=WndProc;
wndclass.cbClsExtra=0;
wndclass.cbWndExtra=0;
wndclass.hInstance=hInstance;
wndclass.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);
wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName=NULL;
wndclass.lpszClassName=TEXT("window窗口创建");
if(!RegisterClass(&wndclass))
return FALSE;
hWnd=CreateWindowExW(TEXT("window窗口创建"),TEXT("window窗口创建"),WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,hInstance,NULL);
ShowWindow(hWnd,nCmdShow);
UpdateWindow(hWnd);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
{
switch(message)
{
case WM_PAINT:HDC hdc;
PAINTSTRUCT ps;
hdc=BeginPaint(hWnd,&ps);
TextOutW(hdc,10,20,TEXT("哈哈,windows编程创建的窗口!"),28);
EndPaint(hWnd,&ps);
return 0;
case WM_DESTROY:PostQuitMessage(0);
return 0;
}
return DefWindowProcW(hWnd,message,wParam,lParam);
}

能告诉我CreateWindowExW函数该怎么写吗?
HWND CreateWindowExW(DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam)

查看全部
YXTS122
YXTS122
2015/10/07 02:33
  • c++
  • 编程
  • windows
  • switch
  • 应用
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

4个回复