您现在的位置:首页 >> 硬件系统 >> 硬件系统 >> 内容

Delphi编写虚拟桌面服务程序

时间:2011/9/3 15:19:00 点击:

  核心提示:program DesktopLoader;//{$APPTYPE CONSOLE}uses Windows,WinSvc,ShellApi;var s:String; iDesktops,jDesk...

program DesktopLoader;
//{$APPTYPE CONSOLE}
uses Windows,WinSvc,ShellApi;
var s:String;
    iDesktops,jDesktops:Integer;
    ServiceName:String='Service_Desktop';

procedure RunProgram(CmdLine:String);
var StartupInfo:TStartUpInfo;
    ProcessInformation:TProcessInformation;
    Handle:THandle;
    d:DWord;
begin
    FillChar(StartUpInfo,SizeOf(StartUpInfo),0);
    StartUpInfo.cb:=SizeOf(TStartUpInfo);
    if CreateProcess(nil,PChar(CmdLine),nil,nil,False, Create_Separate_WOW_VDM,nil,nil, StartUpInfo,ProcessInformation) then
    begin
       Handle:=OpenProcess(Synchronize or Standard_Rights_Required or $FFF, True, ProcessInformation.dwProcessID);
       while GetExitCodeProcess(Handle,d) and (d=Still_Active) do sleep(10);
    end;
end;

代码已经全部打包下载



迅雷专用高速下载

作者:网络 来源:转载
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
  • 盒子文章 技术支持:深圳市麟瑞科技有限公司(www.2ccc.com) © 2025 版权所有 All Rights Reserved.
  • 粤ICP备10103342号-1