VC++小程序找错

来源:百度知道 编辑:UC知道 时间:2024/06/15 07:19:55
#include <windows.h>

LONG WINAPI WndProc (HWND,UINT,WPARAM,LPARAM);

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevinstance,
LPSTR lpszCmdLine, int nCmdShow)
{
WNDCLASS wc;
HWND hwnd;
MSG msg;

wc.style=0; // Class style
wc.lpfnWndProc=(WNDPROC) WndProc; // Window procedure address
wc.cbClsExtra=0; // Class extra bytes
wc.cbWndExtra=0; // Window extra bytes
wc.hInstance=hInstance; // Instance handle
wc.hIcon=loadIcon (NULL,IDI_WINLOGO); // Icon handle
wc.hCursor=LoadCursor (NULL,IDC_ARROW); // Cursor handle
wc.hbrBackground=(HBRUSH) (COLOR_WINDOW+1); // Background color
wc.lpszMenuName=NULL; // Menu name
wc.lpszClassName="MyWndClass";

#include <windows.h>

LONG WINAPI WndProc (HWND,UINT,WPARAM,LPARAM);

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevinstance,
LPSTR lpszCmdLine, int nCmdShow)
{
WNDCLASS wc;
HWND hwnd;
MSG msg;

wc.style=0; // Class style
wc.lpfnWndProc=(WNDPROC) WndProc; // Window procedure address
wc.cbClsExtra=0; // Class extra bytes
wc.cbWndExtra=0; // Window extra bytes
wc.hInstance=hInstance; // Instance handle
wc.hIcon=LoadIcon (NULL,IDI_WINLOGO); // Icon handle
wc.hCursor=LoadCursor (NULL,IDC_ARROW); // Cursor handle
wc.hbrBackground=(HBRUSH) (COLOR_WINDOW+1); // Background color
wc.lpszMenuName=NULL; // Menu name
wc.lpszClassName="MyWndClass"; // WNDCLASS name

RegisterClass (&wc);
hwnd=CreateWindow(
"MyWndClass", // WNDCLASS name
"SDK Application", // Window title
WS_OVERLAPPEDWINDOW, // Window style
CW_USEDEFAU