reactos操作系统实现(167)
来源:互联网 发布:yrpmr.cab 是什么软件 编辑:程序博客网 时间:2024/06/12 03:39
co_UserRedrawWindow函数是用来实现窗口重画的功能,实现代码如下:
#001 BOOL FASTCALL
#002 co_UserRedrawWindow(PWINDOW_OBJECT Window,const RECT* UpdateRect, HRGN UpdateRgn,
#003 ULONG Flags)
#004 {
#005 HRGN hRgn = NULL;
#006
#007 /*
#008 * Step 1.
#009 * Validation of passed parameters.
#010 */
#011
检验是否合适的参数。
#012 if (!IntIsWindowDrawable(Window) ||
#013 (Flags & (RDW_VALIDATE |RDW_INVALIDATE)) ==
#014 (RDW_VALIDATE | RDW_INVALIDATE))
#015 {
#016 return FALSE;
#017 }
#018
#019 /*
#020 * Step 2.
#021 * Transform the parameters UpdateRgn andUpdateRect into
#022 * a region hRgn specified in screencoordinates.
#023 */
#024
创建更新的区域。
#025 if (Flags & (RDW_INVALIDATE |RDW_VALIDATE))
#026 {
根据用户指定的区域进行更新。
#027 if (UpdateRgn != NULL)
#028 {
#029 hRgn = NtGdiCreateRectRgn(0, 0, 0,0);
#030 if (NtGdiCombineRgn(hRgn, UpdateRgn,NULL, RGN_COPY) == NULLREGION)
#031 {
#032 NtGdiDeleteObject(hRgn);
#033 hRgn = NULL;
#034 }
否则更新整个窗口。
#035 else
#036 NtGdiOffsetRgn(hRgn,Window->Wnd->ClientRect.left, Window->Wnd->ClientRect.top);
#037 }
#038 else if (UpdateRect != NULL)
#039 {
#040 if (!IntGdiIsEmptyRect(UpdateRect))
#041 {
#042 hRgn = UnsafeIntCreateRectRgnIndirect((RECT*)UpdateRect);
#043 NtGdiOffsetRgn(hRgn,Window->Wnd->ClientRect.left, Window->Wnd->ClientRect.top);
#044 }
#045 }
#046 else if ((Flags & (RDW_INVALIDATE |RDW_FRAME)) == (RDW_INVALIDATE | RDW_FRAME) ||
#047 (Flags & (RDW_VALIDATE |RDW_NOFRAME)) == (RDW_VALIDATE | RDW_NOFRAME))
#048 {
#049 if(!IntGdiIsEmptyRect(&Window->Wnd->WindowRect))
#050 hRgn =UnsafeIntCreateRectRgnIndirect(&Window->Wnd->WindowRect);
#051 }
#052 else
#053 {
创建客户区窗口区域更新。
#054 if(!IntGdiIsEmptyRect(&Window->Wnd->ClientRect))
#055 hRgn =UnsafeIntCreateRectRgnIndirect(&Window->Wnd->ClientRect);
#056 }
#057 }
#058
#059 /*
#060 * Step 3.
#061 * Adjust the window update regiondepending on hRgn and flags.
#062 */
#063
根据指定的区域进行更新。
#064 if (Flags & (RDW_INVALIDATE |RDW_VALIDATE | RDW_INTERNALPAINT | RDW_NOINTERNALPAINT) &&
#065 hRgn != NULL)
#066 {
#067 IntInvalidateWindows(Window, hRgn,Flags);
#068 }
#069
#070 /*
#071 * Step 4.
#072 * Repaint and erase windows if needed.
#073 */
#074
重新画窗口。
#075 if (Flags & (RDW_ERASENOW | RDW_UPDATENOW))
#076 {
#077 co_IntPaintWindows(Window, Flags,FALSE);
#078 }
#079
#080 /*
#081 * Step 5.
#082 * Cleanup ;-)
#083 */
#084
#085 if (hRgn != NULL)
#086 {
#087 NtGdiDeleteObject(hRgn);
#088 }
#089
#090 return TRUE;
#091 }
- reactos操作系统实现(167)
- reactos操作系统实现(1)
- reactos操作系统实现(2)
- reactos操作系统实现(3)
- reactos操作系统实现(4)
- reactos操作系统实现(5)
- reactos操作系统实现(6)
- reactos操作系统实现(7)
- reactos操作系统实现(8)
- reactos操作系统实现(9)
- reactos操作系统实现(10)
- reactos操作系统实现(11)
- reactos操作系统实现(12)
- reactos操作系统实现(13)
- reactos操作系统实现(14)
- reactos操作系统实现(15)
- reactos操作系统实现(16)
- reactos操作系统实现(17)
- va_start() and va_end()
- 中国年度风云人物
- Mysql LOAD DATA命令的相关事项
- Android MediaPlayer 简单综合应用------列出sdcard里所有.mp3文件,并且可以点击播放!
- 二叉树后序遍历
- reactos操作系统实现(167)
- oracle schema 方案
- Lockless Programming Considerations for Xbox 360 and Microsoft Windows
- 文件字节倒写是使该文件的最后一个字节成为第一个字节,而第一个字节成为最后一个字节。
- Ubuntu安装Oracle后运行Sqlplus报错的解决办法
- 彩虹表的实际应用——取得Windows XP的admin 密码
- 复合文档文件格式研究
- C#中输入农历的方法很实用啊!
- 解决启动Oracle9i的OEM或OMS的常见问题(VTK-1000)