http://msdn.microsoft.com/en-us/library/dd145199(VS.85).aspx

下面是翻译:
An application draws in a window at a variety of times: when first creating a window, when changing the size of the window, when moving the window from behind another window, when minimizing or maximizing the window, when displaying data from an opened file, and when scrolling, changing, or selecting a portion of the displayed data.
一个应用程序在很多时间点,在窗口中进行绘制:当第一次创建窗口,当改变窗口的大小,当从别的窗口后面移动窗口,当最小化或者最大化窗口,当显示一个打开的文件中的数据,当滚动,改变,或者选择显示数据的一部分。

The system manages actions such as moving and sizing a window. If an action affects the content of the window, the system marks the affected portion of the window as ready for updating and, at the next opportunity, sends a WM_PAINT message to the window procedure of the window. The message is a signal to the application to determine what must be updated and to carry out the necessary drawing.

系统管理像移动和改变大小的行为。如果一个行为影响了窗口的内容,系统记录受影响的部分来为更新做准备,在下一个机会中,发送一个WM_PAINT消息给窗口过程.这个消息是一个发给应用程序的信号,这个信号决定了什么需要更新,并且执行必要的绘制。

Some actions are managed by the application, such as displaying open files and selecting displayed data. For these actions, an application can mark for updating the portion of the window affected by the action, causing a WM_PAINT message to be sent at the next opportunity. If an action requires immediate feedback, the application can draw while the action takes place, without waiting for WM_PAINT. For example, a typical application highlights the area the user selects rather than waiting for the next WM_PAINT message to update the area.

有些行为被应用程序管理。例如显示打开的文件和选择显示的数据。对于这些行为,窗口的部分区域会被他们影响,然后,一个应用程序能够为这些区域做标记,致使在下一个机会中发送WM_PAINT消息。如果一个行为需要立即反馈,应用程序可以在行为发生的时候立即绘制,而不是等待WM_PAINT消息。一个典型的应用程序可以高亮用户的选择而不是等待WM_PAINT消息来更新区域。

In all cases, an application can draw in a window as soon as it is created. To draw in the window, the application must first retrieve a handle to a display device context for the window. Ideally, an application carries out most of its drawing operations during the processing of WM_PAINT messages. In this case, the application retrieves a display device context by calling the BeginPaint function. If an application draws at any other time, such as from within WinMain or during the processing of keyboard or mouse messages, it calls the GetDC or GetDCEx function to retrieve the display DC.

无论如何,一旦窗口被创建,就可以在窗口中绘制。为了在窗口中绘制,应用程序必须首先获取一个窗口的显示设备上下文。在理想情况下,一个应用程序在处理wm_paint消息的时候执行它的大部分绘制。在这种情况下,应用程序通过BeginPaint函数获取一个设备上下文。如果一个应用程序在别的时间进行绘制,例如WINMAIN中,或者在鼠标,键盘消息中绘制,它调用GetDC或者GetDCEx函数去获取显示设备上下文。

msdn:什么时候画窗口相关推荐

  1. python画窗口_pyqt中图案如何画在子窗口上

    该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 基本思路是从QWidget派生出一个类重写paintEvent,在里面画图. UI部分代码是这样的 class Ui_Form(object): def ...

  2. VC++ 隐藏控制台程序窗口

    转自:http://hi.baidu.com/sicceer/blog/item/d9c35a810d15c4c8bc3e1ec8.html 设置 #pragma comment( linker, & ...

  3. [MFC] WS_EX_LAYERED 实现透明异形窗口(酷狗歌词、360加速球、窗口边缘阴影)

    关键词:WS_EX_LAYERED. UpdateLayeredWindow PC应用不少都有透明的异形窗口  比如以下程序的效果: 酷狗音乐播放器的歌词窗口(窗口除了歌词内容 其他都是透明的) 36 ...

  4. pygame的学习以及python的巩固(窗口尺寸的显示)

    这次学习的地址是:http://eyehere.net/2011/python-pygame-novice-professional-3/ 这一篇主要讲了全屏显示的切换和改变窗口尺寸等知识,关于复合模 ...

  5. pywin32 获取窗口句柄_Excel VBA | 这个窗口居然关不掉

    我的目标:让中国的大学生走出校门的那一刻就已经具备这些office技能,让职场人士能高效使用office为其服务.支持我,也为自己加油! 还有关不掉的窗体? 先来看下效果: 通过上图,大家很容易看出二 ...

  6. 大三软件工程小项目-小技术集合-客户端界面重画

    客户端源码: http://download.csdn.net/detail/qq78442761/9768668 服务端源码: http://download.csdn.net/detail/qq7 ...

  7. MFC窗口标题栏隐藏

    隐藏: LONG IStyle = ::GetWindowLong(this->m_hWnd, GWL_STYLE);// 等于 DWORD dwStyle = GetStyle(); ::Se ...

  8. 4.2第一个窗口程序

    创建Win32工程和MessageBox函数 前面讲的程序都是使用控制台界面来接受输入.显示输出的.要想使用窗口界面与用户交互必须首先创建一个Win32工程. (1)运行VC++6.0,选择菜单命令& ...

  9. 6.7 【实例】窗口查看器

    6.7.1 窗口界面 程序06WinLooker中包含4个类,CMyApp(应用程序类).CMainWindow(主窗口类).CWindowInfo(管理目标窗口的类)和CMyButton(按钮类). ...

最新文章

  1. ValueError: not enough values to unpack (expected 2, got 1)
  2. 计算机四级考试操作系统单元题,计算机四级考试操作系统单选练习
  3. 2、SQL的基本书写规则
  4. 配置MySQL5.7基于keepalived的GTID的双主复制
  5. C# IO操作(五)文件的递归加载
  6. Leetcode 16. 最接近的三数之和(3Sum Closest)
  7. 安卓 php环境 app,安卓系统lighttpd-php-mysql本地环境
  8. python模块介绍二。
  9. 计算机测试题目及答案6,2017年计算机考试一级上机Word预测试题及答案6
  10. The 2020 ICPC Asia Macau Regional Contest
  11. 【计算机网络】负载均衡
  12. 安徽大学计算机专业参考书目,安徽大学计算机科学与技术(专业学位)考研参考书目...
  13. PTA 6-1 舞伴问题
  14. 【初阶与进阶C++详解】第十八篇:map_set(map_set使用+multiset_multimap使用+模拟map_set)
  15. 超密集组网(UDN)
  16. 关于京牌“以家庭为单位摇号”“京牌可以继承”的不合理性分析
  17. 红帽首席架构师:CentOS Stream 并非要革了 CentOS 的“命”
  18. 【leetcode】2022.1.2 消除游戏
  19. 揭秘可解释推荐系统:知其然,知其所以然
  20. python表白神器

热门文章

  1. go语言的iota是什么意思_关于Golang中的iota
  2. 修改class文件_VM实战(六) - 通过案例深入学习class文件结构原理
  3. linux动态库替换,不要使用 cp 替换正在使用中的Linux 动态库
  4. 将C++里的Mat矩阵保存并由matlab提取分析
  5. 动态显示时采色改为单帧采色
  6. scrapy 怎么添加cookie_scrapy学习之爬虫练习平台5
  7. python中split的用法取第二个分片_python中的split()函数的用法
  8. PARSEC測试集的应用领域和working set的大小
  9. log4net按照不同的【LEVEL】级别输出到不同文件
  10. Mysql如何创建短索引(前缀索引)