• 博客园logo
  • 会员
  • 周边
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
donneyming
博客园    首页    新随笔    联系   管理    订阅  订阅
虚拟桌面程序~

 明白了虚拟桌面的原理后发现就使用了3个函数就可以实现,

源码如下:

 /Files/donneyming/vdesktop.rar

首先创建一个新的桌面,然后调用创建进程函数创建explorer进程,切换桌面 ~

3个主要函数原型如下:

 

HDESK CreateDesktop(

LPCTSTR
lpszDesktop, // name of new desktop

LPCTSTR lpszDevice, // reserved; must be NULL

LPDEVMODE pDevmode, // reserved; must be NULL

DWORD dwFlags, // desktop interaction

ACCESS_MASK dwDesiredAccess, // access of returned handle

LPSECURITY_ATTRIBUTES lpsa // security attributes

);

 

BOOL CreateProcess(

LPCTSTR
lpApplicationName, // name of executable module

LPTSTR lpCommandLine, // command line string

LPSECURITY_ATTRIBUTES lpProcessAttributes, // SD

LPSECURITY_ATTRIBUTES lpThreadAttributes, // SD

BOOL bInheritHandles, // handle inheritance option

DWORD dwCreationFlags, // creation flags

LPVOID lpEnvironment, // new environment block

LPCTSTR lpCurrentDirectory, // current directory name

LPSTARTUPINFO lpStartupInfo, // startup information

LPPROCESS_INFORMATION lpProcessInformation // process information

);

 

BOOL SwitchDesktop(

HDESK
hDesktop // handle to desktop to activate

);
不过程序还有点小问题~在修改中~
posted on 2009-05-22 09:55  donneyming  阅读(593)  评论(1)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3