Pada 11:15 AM 6/16/2003, Rudy Gunawan menulis:
>teman2, gimana agar perintah ShellExecute pd Delphi dilaksanakan satu per 
>satu dari atas ke bawah, misal :
>ShellExecute ke 1 dilaksanakan setelah selesai baru yg ke 2 dst nya, 
>soalnya ketika saya perhatikan yg ke 1 belum selesai yg berikutnya udah 
>dilaksanakan, akibatnya program tdk berjalan spt yg diharapkan.. Mohon 
>pencerahannya.. makasih.

Mungkin bisa dicoba procedure ini RunAndWaitShell berikut ini

procedure RunAndWaitShell(Executable, Arguments:string;Visibility:integer);
   var
      Info:TShellExecuteInfo;
      pInfo:PShellExecuteInfo;
      exitCode:DWord;
   begin
      {Pointer to Info}
      pInfo:[EMAIL PROTECTED];
      {Fill info}
      with Info do
      begin
       cbSize:=SizeOf(Info);
       fMask:=SEE_MASK_NOCLOSEPROCESS;
       wnd:=Handle;
       lpVerb:=nil;
       lpFile:=PChar(Executable);
       {Executable parameters}
       lpParameters:=Pchar(Arguments+#0);
       lpDirectory:=nil;
       nShow:=Visibility;
       hInstApp:=0;
      end;
      {Execute}
      ShellExecuteEx(pInfo);

      {Wait to finish}
      repeat
       exitCode := WaitForSingleObject(Info.hProcess,500);
       Application.ProcessMessages;
      until (exitCode <> WAIT_TIMEOUT);
   end;

begin
   RunAndWaitShell('c:\windows\notepad.exe','c:\autoexec.bat',Sw_ShowNormal);
end;

:: donie ::
/// sepayung berdua, oh indahnya dunia 


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Looking for the latest Free IT White Papers?
Visit SearchNetworking.com to access over 500 white papers.
Get instant access at SearchNetworking.com Today
http://us.click.yahoo.com/8lAzoD/OLNGAA/witMAA/i7folB/TM
---------------------------------------------------------------------~->

Berlangganan: [EMAIL PROTECTED]
Stop Berlangganan: [EMAIL PROTECTED]
Keluhan Milis(Unbouncing,spam,dll): [EMAIL PROTECTED] 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


Kirim email ke