刚学习C++的菜鸟,请各位大侠帮帮我看一下源程序哪儿出错了
#include<windows.h>LRESULT CALLBACK WindowProc(HWND hwnd,
UINT Umsgld,
WPARAM wParam,
LPARAM lParam);
int WINAPI WinMain(HINSTANCE hinstance,
HINSTANCE hPrevInstance,
LPSTR pszCmdlind,
int nCmdShow)
{
static char szAppName[] = "无标题3";
HWND hwnd; MSG msg;
WNDCLASS wndclass;
wndclass.style = 0;
wndclass.lpfnWndProc = WindowProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hinstance;
wndclass.hCursor=LoadIcon(NULL, IDI_APPLICATION);
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground =(HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName =(LPCSTR) LoadMenu(hinstance, "MainMenu");
wndclass.lpszClassName = szAppName;
if (RegisterClass( &wndclass ) == 0)
{
return 0;
}
hwnd = CreateWindow(
szAppName,
szAppName,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hinstance,
NULL);
if (hwnd == 0)
{
return 0;
}
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WindowProc(HWND hwnd,
UINT uMsgld,
WPARAM wParam,
LPARAM lParam)
{static char*pszHello = "HELLO,HOW APE YOU?";
switch (uMsgld)
{
case WM_PAINT:
HDC hDC;
PAINTSTRUCT paintStruct;
hDC = BeginPaint(hwnd, &paintStruct);
TextOut(hDC, 0, 0, pszHello, lstrlen(pszHello));
EndPaint(hwnd, &paintStruct);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
default:
return DefWindowProc(hwnd, uMsgld, wParam, lParam);
}
}