首页 > 代码库 > 创建虚拟桌面的代码(重启桌面进程)(使用GetThreadDesktop,CreateDesktop,SetThreadDesktop等函数)
创建虚拟桌面的代码(重启桌面进程)(使用GetThreadDesktop,CreateDesktop,SetThreadDesktop等函数)
在upk 里挖坟得来,有兴趣查查这几个函数...
[cpp] view plain copy print?
- #include "windows.h"
- #pragma comment(lib,"user32.lib")
- int main()
- {
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
- char DeskName[]="pp";
- HDESK hold = GetThreadDesktop(GetCurrentThreadId());
- HDESK hhdesk = CreateDesktop( DeskName, NULL, NULL, DF_ALLOWOTHERACCOUNTHOOK, GENERIC_ALL, NULL);
- SwitchDesktop( hhdesk);
- SetThreadDesktop( hhdesk);
- ZeroMemory( &si, sizeof(si) );
- si.cb = sizeof(si);
- si.lpDesktop = DeskName;
- ZeroMemory( π, sizeof(pi) );
- CreateProcess( NULL, "explorer", NULL, NULL, FALSE, 0, NULL, NULL, &si, π);
- Sleep(60000);
- SwitchDesktop( hold);
- CloseDesktop( hhdesk);
- }
http://blog.csdn.net/wangningyu/article/details/5179221
创建虚拟桌面的代码(重启桌面进程)(使用GetThreadDesktop,CreateDesktop,SetThreadDesktop等函数)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。