Windows编程基本知识-V0.ppt_第1页
Windows编程基本知识-V0.ppt_第2页
Windows编程基本知识-V0.ppt_第3页
Windows编程基本知识-V0.ppt_第4页
Windows编程基本知识-V0.ppt_第5页
已阅读5页,还剩9页未读, 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Windows编程基本知识 ITEducation Training Date 27January2020 本章主要内容 Windows应用程序的基本概念Windows应用程序中的数据类型Windows应用程序的消息机制Windows操作系统与Windows应用程序的主函数 窗口函数之间的关系使用函数对Windows应用程序进行封装 ITEducation Training Date 27January2020 Windows应用程序使用的界面是由各种图形元素组成的图形界面 各个图形元素具有不同的功能 应用程序的用户主要是通过键盘和鼠标对应用程序界面上的图形元素进行操作来与Windows应用程序进行交互的 1 1Windows应用程序的基本概念 ITEducation Training Date 27January2020 Windows提供了大量预定义的用C语言编写的函数 这些函数就叫做API ApplicationProgrammingInterface 函数 早期的Windows应用程序设计人员要使用这些API函数来编写程序 1 1Windows应用程序的基本概念 ITEducation Training Date 27January2020 在Windows应用程序中 存在着许多与DOS应用程序不同的复杂对象 例如窗口 按钮 滚动条等等 Windows把为这种复杂对象所定义的标识叫做句柄 1 1Windows应用程序的基本概念 ITEducation Training Date 27January2020 1 1Windows应用程序的基本概念 ITEducation Training Date 27January2020 Windows应用程序中的数据量非常大 为了提高应用程序的可读性 Windows给许多基本数据类型定义了别名 例如 TypedefunsignedlongDWORD TypedefintBOOL typedefunsignedcharBYTE typedefunsignedshortWORD 等等 1 1Windows应用程序的基本概念 ITEducation Training Date 27January2020 Windows应用程序还使用了一些结构类型的数据 例如 typedefstructtag POINT LONGx y POINT 描述了一个点的位置 1 1Windows应用程序的基本概念 ITEducation Training Date 27January2020 事件与消息 1 1Windows应用程序的基本概念 typedefstructtagMSG HWNDhwnd UINTmessage WPARAMwParam LPARAMlParam DWORDtime POINTpt MSG 这是一个事件 事件的描述是一个消息 ITEducation Training Date 27January2020 1 1Windows应用程序的基本概念 ITEducation Training Date 27January2020 1 1Windows应用程序的基本概念 while GetMessage 自消息队列获取消息 把消息派发给Windows系统 系统处理了消息后返回 消息循环 ITEducation Training Date 27January2020 1 2Windows应用程序的结构 主函数 窗口函数 ITEducation Training Date 27January2020 1 2Windows应用程序的结构 用窗口类结构描述窗口 charlpszClassName 窗口 WNDCLASSwc 定义一个窗口类变量wc style 0 wc lpfnWndProc WndProc wc cbClsExtra 0 wc cbWndExtra 0 wc hInstance hInstance wc hIcon LoadIcon NULL IDI APPLICATION wc hCursor LoadCursor NULL IDC ARROW wc hbrBackground HBRUSH GetStockObject WHITE BRUSH wc lpszMenuName NULL wc lpszClassName lpszClassName ITEducation Training Date 27January2020 1 2Windows应用程序的结构 注册窗口类 RegisterClass 创建窗口 hwnd CreateWindow lpszClassName Windows WS OVERLAPPEDWINDOW 120 50 800 600 NULL NULL hInstan

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论