🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.delphi.bazy-danych
Article #70583

Re: shellexecute

#70583
From: jh
Date: Mon, 06 Aug 2007 07:19
33 lines
1717 bytes
CreateProcess. Poniżej taki prosty przykładzik:

procedure RunNotepad;
var
    SI: TStartupInfo;
    PI: TProcessInformation;
    S: String;
begin
 s := 'notepad.exe';
 FillChar(SI, SizeOf(SI), 0);
 with SI do
 begin
  dwFlags := STARTF_USESHOWWINDOW;
  wShowWindow := SW_SHOW;
  cb := SizeOf(TStartupInfo);
 end;

 if CreateProcess(nil, PChar(S), nil, nil, FALSE, NORMAL_PRIORITY_CLASS, 
nil, nil, SI, PI) then
  with PI do
  begin
   WaitForInputIdle(hProcess, 1000);
    // może być inna wartość: tu mam czekaj 10 sekund na zamknięcie
   WaitForSingleObject(hProcess, 10000);
   WaitForSingleObject(hThread, 10000);
   CloseHandle(hProcess);
   CloseHandle(hThread);
  end;
  ShowMessage('Notatnik zamknięty')
end;


Jacek 
Technical Details
Message-ID: <f96iaf$rs2$1@nemesis.news.tpi.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.nask.pl!news.nask.org.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
References: <f95s2j$egb$1@nemesis.news.tpi.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.nask.pl!news.nask.org.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
From: "jh" <jh@radiokropkakielcekropkapl.nic>
Newsgroups: pl.comp.lang.delphi.bazy-danych
Subject: Re: shellexecute
Date: Mon, 6 Aug 2007 09:19:08 +0200
Organization: tp.internet - http://www.tpi.pl/
Lines: 34
Message-ID: <f96iaf$rs2$1@nemesis.news.tpi.pl>
References: <f95s2j$egb$1@nemesis.news.tpi.pl>
NNTP-Posting-Host: m1-10.kielce.com.pl
Mime-Version: 1.0
X-Trace: nemesis.news.tpi.pl 1186385039 28546 195.116.213.10 (6 Aug 2007 07:23:59 GMT)
X-Complaints-To: usenet@tpi.pl
NNTP-Posting-Date: Mon, 6 Aug 2007 07:23:59 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit