| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 444 人关注过本帖
标题:不知道哪里错了,一个简单的程序
取消只看楼主 加入收藏
zh286091487
Rank: 1
等 级:新手上路
帖 子:36
专家分:0
注 册:2007-3-22
收藏
 问题点数:0 回复次数:0 
不知道哪里错了,一个简单的程序

#include<windows.h>


LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);

int WINAPI WINMIAN
(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow
)
{
WNDCLASS wndclass;
wndclass.cbClsExtra =0;
wndclass.cbWndExtra =0;
wndclass.hbrBackground =(HBRUSH)GetStockObject(GRAY_BRUSH);
wndclass.hCursor =LoadCursor(NULL,IDC_CROSS);
wndclass.hIcon =LoadIcon(NULL,IDI_WINLOGO);
wndclass.hInstance=hInstance;
wndclass.lpfnWndProc =WindowProc;
wndclass.lpszClassName ="firstwindow";
wndclass.lpszMenuName =NULL;
wndclass.style =CS_HREDRAW|CS_VREDRAW|CS_NOCLOSE;

RegisterClass(&wndclass);

HWND hwnd;
hwnd=CreateWindow("firstwindow","an easy window",WS_OVERLAPPED,CW_USEDEFAULT ,
CW_USEDEFAULT ,CW_USEDEFAULT ,CW_USEDEFAULT ,NULL,NULL,hInstance,NULL);

ShowWindow(hwnd,SW_SHOWNORMAL);
UpdateWindow(hwnd);

MSG msg;
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
switch(uMsg)
{
case WM_CHAR:
break;
case WM_LBUTTONDOWN:
break;
case WM_PAINT:
break;
case WM_CLOSE:
/*if(MessageBox(hwnd,"是否要关闭窗口?","提示",0)==IDYES)
{
DestroyWindow(hwnd);
}*/
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd,uMsg,wParam,lParam);
}
return 0;

}




Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/窗口代码.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

窗口代码.exe - 2 error(s), 0 warning(s)

搜索更多相关主题的帖子: include 
2007-04-23 18:31
快速回复:不知道哪里错了,一个简单的程序
数据加载中...
 
   



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

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