Вниз
Скачать: CL | DM;

Запуск других приложений из моего с параметрами   Найти похожие ветки 

← →
oleg_SYS ©   (2004-03-21 22:04) [0]

Нужно запустить другую программу, но передать ей ещё параметр запуска (это DOS-приложение).
Код:
ShellExecute (Form1.Handle, nil, PChar("C:\prog.exe parametri"), nil, nil, SW_RESTORE);

Не работает :(
Функция WinExec тоже не рабоатет.
Чё делать?


← →
Плохиш   (2004-03-21 22:12) [1]


> Чё делать?

Застрелиться!


← →
oleg_SYS ©   (2004-03-21 22:33) [2]

О, нашёл!


procedure TForm1.Button1(Sender: TObject);
var
 SEInfo: TShellExecuteInfo;
 ExitCode: DWORD;
 ExecuteFile, ParamString, StartInString: string;
begin
 ExecuteFile := "c:\autoехес.bat";
 FillChar(SEInfo, SizeOf(SEInfo), 0);
 SEInfo.cbSize := SizeOf(TShellExecuteInfo);
 with SEInfo do
  begin
    fMask := SEE_MASK_NOCLOSEPROCESS;
    Wnd := Application.Handle;
    lpFile := PChar(ExecuteFile);
    lpParameters := PChar(ParamString);
    lpDirectory := PChar(StartInString);
    nShow := SW_SHOWNORMAL;
  end;
 if ShellExecuteEx(@SEInfo) then
   begin
    repeat
     Application.ProcessMessages;
     GetExitCodeProcess(SEInfo.hProcess, ExitCode);
   until (ExitCode <> STILL_ACTIVE) or Application.Terminated;
   end;
end;


← →
Cardinal ©   (2004-03-21 22:44) [3]

>Не работает :(

У меня работает почему-то



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.034 c
14-1082296866
q13
2004-04-18 18:01
2004.04.11
задача:распределить число между элементами массива


7-1075231094
Ig
2004-01-27 22:18
2004.04.11
Скрытие файлов, папок и др.


1-1080219438
TiMER
2004-03-25 15:57
2004.04.11
перехват определенных файлов


3-1078987844
SAMOVAR
2004-03-11 09:50
2004.04.11
как из Делфи обратиться к объекту FastReport?


4-1075903468
UNIVERSAL
2004-02-04 17:04
2004.04.11
Хук на мышь.




   Наверх