找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 804|回复: 5

[讨论]C++问题

[复制链接]
发表于 2009-11-3 02:58:11 | 显示全部楼层 |阅读模式 IP:江苏扬州
谁看的懂,发表意见

#include <windows.h>
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); /* Declare Windows procedure */
char szClassName[ ] = "WindowsApp"; /* Class Name */
int WINAPI WinMain(HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The WNDCLASSEX structure */
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WndProc; /* This function is called by windows */
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof(WNDCLASSEX);
wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor(NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
wincl.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
/* Register the window class, if fail quit the program */
if(!RegisterClassEx(&wincl)) return 0;
/* The class is registered, create the window*/
hwnd = CreateWindowEx(
0,
szClassName,
"Simple Windows App",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
500,
300,
HWND_DESKTOP,
NULL,
hThisInstance,
NULL
);
/* Make the window visible on the screen */
ShowWindow(hwnd, nFunsterStil);
/* Run the message loop. It will run until GetMessage( ) returns 0 */
while(GetMessage(&messages, NULL, 0, 0))
{
TranslateMessage(&messages);
DispatchMessage(&messages);
}
/* The program return-value is 0 - The value that PostQuitMessage( ) gave */
return messages.wParam;
}
/* This function is called by the Windows function DispatchMessage( ) */
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_DESTROY:
PostQuitMessage(0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc(hwnd, message, wParam, lParam);
}
return 0;
}
发表于 2009-11-3 02:58:12 | 显示全部楼层 IP:江苏扬州
要发表什么意见啊~!我今天第一天看api,只能看懂你的程序的意思
回复

使用道具 举报

发表于 2009-11-3 02:58:13 | 显示全部楼层 IP:江苏扬州
一个最基本的窗口
回复

使用道具 举报

发表于 2009-11-3 02:58:15 | 显示全部楼层 IP:江苏扬州
不过你加了注释以后,到是很适合初学者看,很明白,比书上写得还清楚。顶一下
回复

使用道具 举报

发表于 2009-11-3 02:58:16 | 显示全部楼层 IP:江苏扬州
请问注册窗口类所有的属性都要显示说明吗?(所有的成员都要赋值?)
没有默认的吗?哪些可以默认?
窗口类的属性一共有哪些啊?可以都列出来,并给出解释吗?
回复

使用道具 举报

发表于 2009-11-3 02:58:19 | 显示全部楼层 IP:江苏扬州
这个在《Windows 程序设计》中有详细解释,或者你可以研究MSDN
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-30 11:24 , Processed in 0.309455 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表