Советы по Delphi

       

WinExecAndWait


Function WinExecAndWait(Path : Pchar; Visibility : word) : word;varInstanceID : THandle;Msg : TMSg;beginInstanceID := WinExec(Path,Visibility);if InstanceID < 32 then { значение меньше 32 говорит об ошибке Exec }WinExecAndWait := InstanceIDelsebeginRepeatWhile PeekMessage(Msg,0,0,0,PM_REMOVE) dobeginif Msg.Message = WM_QUIT thenhalt(Msg.wParam);TranslateMessage(Msg);DispatchMessage(Msg);end;until GetModuleUsage(InstanceID) = 0;WinExecAndWait := 32;end;end;

- Pat Ritchey [000920]



Содержание раздела