dev.gamez.lv Forum Index dev.gamez.lv
Latvian Game Developers Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 

exec

 
dev.gamez.lv Forum Index -> Programmēšana
View previous topic :: View next topic  
Author Message
ytterbium



Joined: 19 Apr 2004
Posts: 33

PostPosted: Sun May 23, 2004 1:50 pm    Post subject: exec

Ka no delfiem palaist citu programmu un tikmeer "iesaldeet" savejo kamer ta otra beidz darbu, nu apmeram ka exec(ja nemaldos) paskalaa, un pec beigshanas atgriezties sava programmaa.
Back to top
View user's profile
Kamazs
Guru
Guru


Joined: 17 Jan 2003
Posts: 829
Location: The glorious ancient city of Loja

PostPosted: Sun May 23, 2004 2:12 pm    Post subject:

Paskaties ieksh Delphi Helpa ShellExecute(..) sintaksi un parametrus. Tas gan tikai palaidiis otru programmu, iesaldeet iisti neiesaldees. Lai iesaldeetu vajadzees shitaadu funkciju -
Quote:

function WinExecAndWait32(FileName:String):integer;
var
zAppName:array[0..512] of char;
zCurDir:array[0..255] of char;
WorkDir:String;
StartupInfo:TStartupInfo;
ProcessInfo:TProcessInformation;
begin
StrPCopy(zAppName,FileName);
GetDir(0,WorkDir);
StrPCopy(zCurDir,WorkDir);
FillChar(StartupInfo,Sizeof(StartupInfo),#0);
StartupInfo.cb := Sizeof(StartupInfo);

StartupInfo.dwFlags := STARTF_USESHOWWINDOW;

if not CreateProcess(nil,
zAppName, { komandrindas parametri}
nil, { process security}
nil, { thread security }
false, { inheritance}
CREATE_NEW_CONSOLE or { flagi taisot}
NORMAL_PRIORITY_CLASS,
nil, { pointer to new environment block }
nil, { pointer to current directory name }

StartupInfo, { pointer to STARTUPINFO }
ProcessInfo) then Result := -1 { pointer to PROCESS_INF }

else begin

repeat
GetExitCodeProcess(ProcessInfo.hProcess,dword(Result));
application.processmessages;
until Application.Terminated or (result <> STILL_ACTIVE);

end;
end;


Shito kaut kur guuglee atradu, biok pamainiiju, straadaa kaa vajag. Pahrii kaa reiz vareeja redzeet piemeeru kaa taa darbojaas.
_________________
...un es uzskatu, ka Fallout ir etalons
Back to top
View user's profile Send e-mail Visit poster's website
Display posts from previous:   
dev.gamez.lv Forum Index -> Programmēšana All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group