C语言程序设计基础.ppt

  1. 1、本文档共517页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
char *hello="你好,这里是窗口演示程序!"; HDC hdc; // 说明设备描述句柄 PAINTSTRUCT ps; //说明用来绘制用户程序客户区所需信息的结构 //多分支结构用来根据消息的不同值进行相应的处理 switch(message) { 完整的源程序清单 case WM_PAINT: //此消息要在用户的客户区进行绘图输出 hdc=BeginPaint(hWnd,&ps); TextOut(hdc,120,100,hello,lstrlen(hello)); EndPaint(hWnd,&ps); break; case WM_DESTROY: //此消息要结束窗口过程 PostQuitMessage(0); break; default: // 默认情况下,系统处理余下的消息 return (DefWindowProc(hWnd,message,wParam,lParam)); } UpdateWindow发出 WM_PAINT An application sends the WM_PAINT message when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function. WM_PAINT hdc = (HDC) wParam; // the device context to draw in Parameters hdc Handle to the device context to draw in. If this parameter is NULL, use the default device context. This parameter is used by some common controls to enable drawing in a device context other than the default device context. Other windows can safely ignore this parameter. Return Values An application returns zero if it processes this message. wcex.style =CS_HREDRAW|CS_VREDRAW; // 窗口风格 wcex.lpfnWndProc=(WNDPROC)MainWndProc; // 窗口函数过程 wcex.cbClsExtra =0; // 类变量占用的附属存储空间 wcex.cbWndExtra =0; // 实例变量占用的附属存储空间 wcex.hInstance =hInstance; // 模块句柄,用于系统操作本程序 wcex.hIcon =LoadIcon(NULL, IDI_APPLICATION); // 图标对象句柄 wcex.hCursor =LoadCursor(NULL,IDC_ARROW); // 光标对象句柄 wcex.hbrBackground =GetStockObject(WHITE_BRUSH); // 刷子对象 wcex.lpszMenuName = NULL; // 菜章对象字符串 wcex.lpszClassName ="DemoWClass"; // 标识类名字的串 ”DIALOGMENU” 将菜单标识符在定义窗口类时挂上 ”DIALOGMENU” ABOUTBOX DIALOG DISCARDABLE 20, 25, 124, 77 STYLE DS_MODALFRAME | DS_3DLOOK | DS_CONTRO

文档评论(0)

kaku + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8124126005000000

1亿VIP精品文档

相关文档