标题:最基本的一个小错误,请大家指点 谢谢了
取消只看楼主
yaoguai2005
Rank: 1
等 级:新手上路
帖 子:168
专家分:0
注 册:2005-9-11
 问题点数:0 回复次数:1 
最基本的一个小错误,请大家指点 谢谢了

#include <windows.h>


LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;


int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,

PSTR szCmdLine, int iCmdShow)

{

static TCHAR szAppName[] = TEXT ("HelloWin") ;

HWND hwnd ;

MSG msg ;

WNDCLASS wndclass ;


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= szAppName ;


if (!RegisterClass (&wndclass))

{

MessageBox ( NULL, TEXT ("This program requires Windows NT!"),

szAppName, MB_ICONERROR) ;

return 0 ;

}

hwnd= CreateWindow( szAppName, // window class name

TEXT ("The Hello Program"), // window caption

WS_OVERLAPPEDWINDOW, // window style

CW_USEDEFAULT,// initial x position

CW_USEDEFAULT,// initial y position

CW_USEDEFAULT,// initial x size

CW_USEDEFAULT,// initial y size

NULL, // parent window handle

NULL, // window menu handle

hInstance, // program instance handle

NULL) ; // creation parameters

ShowWindow (hwnd, SW_SHOWMINIMIZE) ;//就是这句,该咋样声明SW_SHOWMINIMIZE这个标识符呢

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)

{

HDC hdc ;

PAINTSTRUCT ps ;

RECT rect ;

switch (message)

{





case WM_DESTROY:

PostQuitMessage (0) ;

return 0 ;

}

return DefWindowProc (hwnd, message, wParam, lParam) ;

}

[此贴子已经被作者于2006-4-3 20:12:43编辑过]

搜索更多相关主题的帖子: include 
2006-04-03 20:04
yaoguai2005
Rank: 1
等 级:新手上路
帖 子:168
专家分:0
注 册:2005-9-11
得分:0 

真是好人啊,谢谢了,


2006-04-04 02:29



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-54870-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.112920 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved