``这么简单`我都错``HELP ME
#include <windows.h>
#include "resource.h"
LPCTSTR lpszAppName = "dbc11";
LPCTSTR lpszTitle = "dbcsss";
HINSTANCE hInst;
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg,
WPARAM wParam, LPARAM lParam);
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
hInst = hInstance;
WNDCLASS wc;
HWND hWnd;
if (! hPrevInstance)
{
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hInstance = hInstance;
wc.lpfnWndProc = (WNDPROC)WndProc;
wc.lpszClassName = lpszAppName;
wc.lpszMenuName = (LPCTSTR)IDR_MENU1;
wc.style = 0;
if (! RegisterClass(& wc))
return false;
MessageBox(NULL, "...", "", MB_OK);
}
else
return false;
hWnd = CreateWindow(lpszAppName, "..",
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 300, 350,
NULL, NULL, hInstance, NULL);
MessageBox(NULL, "WNDWNDWNDWND", "asdf", MB_OK);
if (! hWnd)
return false;
MessageBox(NULL, "...", ".....", MB_OK);
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
MSG msg;
while(GetMessage(& msg, 0, 0, 0))
{
TranslateMessage(& msg);
DispatchMessage(& msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_COMMAND:
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
DefWindowProc(hWnd, uMsg, wParam, lParam);
break;
}
return 0;
}
错拿``啊???????????