- 1、本文档共36页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
德州学院 计算机系 德州学院计算机系 Visual C++ 与面向对象程序设计 第6章 Windows标准控件 德州学院 计算机系 主讲教师 韩金姝 本章主要内容 控件概述 按钮控件 滚动条控件 静态控件(自学) 列表框子窗口控件 编辑框控件 控件概述 控件是Windows图形用户界面的主要组成部分之一。属于一般窗口,具有通用的窗口性质,且可使用ShowWindow和MoveWindow等窗口管理函数对其操作 创建控件的两种方式: 在对话框中制定控件。 调用CreateWindow/CreateWindowEx创建窗口类控件,和主窗口类似,填写WNDCLASS结构并注册。或使用Windows系统预定义的窗口类 控件概述 窗口间消息传递 作为子窗口的控件通过向其父窗口发送WM_COMMAN消息进行通信,wParam参数包含了子窗口的标志,低位是子窗口句柄,高位是通知代码(各种类型的操作表6-2) 应用程序调用,向特定子窗口发送消息 LRESULT SendMessage( HWND hWnd,UINT Msg, WPARAM wParam, LPARAM lParam); 对话框控件:SendDlgItemMessage( ) 控件概述 SendMessage An application sends a BM_SETSTYLE message to change the style of a button. lResult?=?SendMessage( ????//?returns?LRESULT?in?lResult ??? (HWND) hWndControl, ????// handle to destination control ???(UINT) BM_SETSTYLE,// message ID (WPARAM)?wParam, ????//?=?(WPARAM)?()?wParam;? ??(LPARAM)?lParam ????//?=?(LPARAM)?()?lParam; ); wParam :Specifies the new button style. This parameter can be a combination of button styles. For a table of button styles, see Button Styles. lParam :The low-order word of lParam specifies whether the button is to be redrawn. A value of TRUE redraws the button; a value of FALSE does not redraw the button. 控件概述 常用子窗口操作函数 应用程序对控件的操作,实质是子窗口操作的一种类型(P113) 获得指定窗口标题或文本:GetWindowText( )/GetDlgItemText( ) 设置窗口标题或文本:SetWindowText( )/SetDlgItemText( ) 激活或禁止窗口:EnableWindow( ) 关闭窗口:DestroyWindow( ) 控件概述 常用子窗口操作函数 5. 移动窗口或改变窗口大小:MoveWindow The MoveWindow function changes the position and dimensions of the specified window. For a top-level window, the position and dimensions are relative to the upper-left corner of the screen. For a child window, they are relative to the upper-left corner of the parent windows client area. bRepaint:[in] Specifies whether the window is to be repainted. If this parameter is TRUE, the window receives a message. If the parameter is FALSE, no repainting of any kind occurs. This applies to the client area, the nonclient area (incl
您可能关注的文档
- 第三章 金融资产投资(基金投资).ppt
- 2005-天俯江南案列.ppt
- 高层建筑体系调研.ppt
- 学习者中心的原理.ppt
- 广东金融学院——案例分析—马云与阿里巴巴.ppt
- 攻克XX体育中心体育场工程变截面斜柱施工难关.ppt
- 第7章_桥梁延性抗震设计.ppt
- super生涯理論.ppt
- 何风彩《爱与责任是师德之魂》.ppt
- 复件 第二讲增值税.ppt
- 2024年江西省寻乌县九上数学开学复习检测模拟试题【含答案】.doc
- 2024年江西省省宜春市袁州区数学九上开学学业水平测试模拟试题【含答案】.doc
- 《GB/T 44275.2-2024工业自动化系统与集成 开放技术字典及其在主数据中的应用 第2部分:术语》.pdf
- 中国国家标准 GB/T 44275.2-2024工业自动化系统与集成 开放技术字典及其在主数据中的应用 第2部分:术语.pdf
- GB/T 44285.1-2024卡及身份识别安全设备 通过移动设备进行身份管理的构件 第1部分:移动电子身份系统的通用系统架构.pdf
- 《GB/T 44285.1-2024卡及身份识别安全设备 通过移动设备进行身份管理的构件 第1部分:移动电子身份系统的通用系统架构》.pdf
- 中国国家标准 GB/T 44285.1-2024卡及身份识别安全设备 通过移动设备进行身份管理的构件 第1部分:移动电子身份系统的通用系统架构.pdf
- GB/T 44275.11-2024工业自动化系统与集成 开放技术字典及其在主数据中的应用 第11部分:术语制定指南.pdf
- 中国国家标准 GB/T 44275.11-2024工业自动化系统与集成 开放技术字典及其在主数据中的应用 第11部分:术语制定指南.pdf
- 《GB/T 44275.11-2024工业自动化系统与集成 开放技术字典及其在主数据中的应用 第11部分:术语制定指南》.pdf
文档评论(0)