1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69:
| unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, appbar, StdCtrls, ShellApi;
type TForm1 = class(TForm) Button1: TButton; Button3: TButton; AppBar1: TAppBar; procedure Button1Click(Sender: TObject); procedure Button3Click(Sender: TObject); private { Private-Deklarationen } public { Public-Deklarationen } end;
var Form1: TForm1; TListe: TList; FensterHandle: HWND;
implementation
{$R *.dfm} function RunProcess(FileName: string): Longword; var StartupInfo: TStartupInfo; ProcessInfo: TProcessInformation; begin FillChar(StartupInfo, SizeOf(StartupInfo),#0); StartupInfo.cb := SizeOf(StartupInfo); StartupInfo.dwFlags := STARTF_USEPOSITION and STARTF_USESHOWWINDOW and STARTF_USESIZE; StartupInfo.dwX := 100; StartupInfo.dwY := 100; StartupInfo.wShowWindow := SW_SHOWDEFAULT; StartupInfo.dwXSize := 600; StartupInfo.dwYSize := 400; if not CreateProcess(nil, @Filename[1], nil, nil, True, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nil, nil, StartupInfo, ProcessInfo) then Result := WAIT_FAILED; end;
procedure TForm1.Button1Click(Sender: TObject); begin Close end;
procedure TForm1.Button3Click(Sender: TObject); begin RunProcess('D:\Microsoft Office\Office10\WinWord.exe'); end;
end. |