这代码怎么不能出现窗口
#include<windows.h>LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
int WINAPI WinMain(HINSTANCE hThis, HINSTANCE hPrev, LPSTR szCmdLine, int iCmdShow)
{
// UNREFERENCED_PARAMETER(hPrev);
// UNREFERENCED_PARAMETER(szCmdLine);
WNDCLASS wndex ;
HWNDhWnd;
MSG msg;
wndex.cbClsExtra = 0;
wndex.cbWndExtra = 0;
wndex.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wndex.hCursor= LoadCursor(NULL, IDC_ARROW);
wndex.hIcon = LoadIcon(NULL, IDI_APPLICATION );
wndex.hInstance = hThis;
wndex.lpfnWndProc = WndProc;
wndex.lpszClassName = TEXT("GUIProject");
wndex.lpszMenuName = NULL;
wndex.style = CS_HREDRAW ;
if (!RegisterClass(&wndex))
{
MessageBox(NULL, TEXT("我爱你"), TEXT("I LOVE YOU SO MUCH"), MB_OK);
return -1;
}
hWnd = CreateWindow(wndex.lpszClassName, TEXT("My First Windows Program"),
WS_OVERLAPPEDWINDOW, 100, 100, 640, 480,
NULL, NULL, hThis, NULL);
// hWnd = CreateWindow( TEXT("GUIProject"), TEXT("GUI Project"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
// CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hThis, NULL);
ShowWindow(hWnd, iCmdShow);
UpdateWindow(hWnd);
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
//DestroyWindow(hWnd);
//UnregisterClass(wndex.lpszClassName,hThis);
return (int) msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
///case WM_CLOSE:
// {
// PostQuitMessage(0);
// break;
// }
case WM_RBUTTONDOWN:
{
MessageBox(NULL, TEXT("晚安!"), TEXT("你好!"), MB_OK);
}
defult:
{
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
}
return 0;
}
74行
defult
=>
default 无符号整形 发表于 2016-11-19 11:25
74行
defult
=>
太感谢了。 qtyj123 发表于 2016-11-19 11:30
太感谢了。
如果您的【问题求助】得到满意的解答,请自行将分类修改为【已经解决】!{:10_254:} 无符号整形 发表于 2016-11-19 11:33
如果您的【问题求助】得到满意的解答,请自行将分类修改为【已经解决】!
怎么改呢?
页:
[1]