Posted on 2010-01-31 09:10
S.l.e!ep.¢% 阅读(475)
评论(0) 编辑 收藏 引用 所属分类:
VC
#include "windows.h"
void main()
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
char DeskName[]="ppp";
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( &pi, sizeof(pi) );
CreateProcess( NULL, "explorer", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
Sleep(10000);
SwitchDesktop( hold);
CloseDesktop( hhdesk);
}