reactos操作系统实现(175)
来源:互联网 发布:mac自带的画图软件 编辑:程序博客网 时间:2024/05/16 13:58
GetDesktopWindow函数主要用来获取桌面窗口的句柄。下面就是这个函数的实现代码:
#001 HWND WINAPI
#002 GetDesktopWindow(VOID)
#003 {
#004 PWINDOW Wnd;
#005 HWND Ret = NULL;
#006
使用SEH机制来获取桌面窗口。
#007 _SEH2_TRY
#008 {
调函数GetThreadDesktopWnd来获取当前线程的桌面句柄。
#009 Wnd = GetThreadDesktopWnd();
#010 if (Wnd != NULL)
从窗口指针里获取这个窗口句柄。
#011 Ret = UserHMGetHandle(Wnd);
#012 }
#013 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
#014 {
#015 /* Do nothing */
#016 }
#017 _SEH2_END;
#018
#019 return Ret;
#020 }
GetThreadDesktopWnd函数:
#001 PWINDOW
#002 FASTCALL
#003 GetThreadDesktopWnd(VOID)
#004 {
通过函数GetThreadDesktopInfo获取桌面信息结构,然后再从结构里获取窗口句柄。
#005 PWINDOW Wnd =GetThreadDesktopInfo()->Wnd;
#006 if (Wnd != NULL)
转换桌面指针为用户空间合适的窗口对象。
#007 Wnd = DesktopPtrToUser(Wnd);
#008 return Wnd;
#009 }
- reactos操作系统实现(175)
- 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)
- 应该如何正确对待员工的抱怨
- 扩展QTP的WebTable测试对象
- log4j学习札记
- [转帖]输入一个新的网址后到完全显示页面,浏览器做了哪些工作?
- 半自动化ORM:iBATIS
- reactos操作系统实现(175)
- struts二 adtion 中取得取得和设立application,request,session,response
- 用 Hadoop 进行分布式并行编程, 第 1 部分
- 欲知Tomcat, 推荐一本书。
- Hadoop分布式文件系统:架构和设计要点
- 新的一年又来了
- 数据库知识
- MyEclipse连接Oracle数据库Cannot access NLS data files or invalid environment specified
- 2010.1.7监听器