bei folgendem Programm lassen sich die drei verschiedenen Programme (über die RadioButtons ausgewählt) leider nicht öffnen. Über den Erstellungsordner funktioniert dies allerdings.
Code: Alles auswählen
unit uAuswahl;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ExtCtrls, Buttons, ShellAPI;
type
{ TForm1 }
TForm1 = class(TForm)
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Memo1: TMemo;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
RadioGroup1: TRadioGroup;
procedure BitBtn1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
if RadioButton1.Checked= true then
ShellExecute(Form1.Handle, 'open', PChar('C:\Users\Jonas\Documents\BUSSE\BUSSE_Programme\Gesamtprogramm_privat\pgesamt1.exe'), nil, nil, 1);
Label1.Caption:='';
if RadioButton2.Checked=true then
ShellExecute(Form1.Handle, 'open', PChar('C:\Users\Jonas\Documents\BUSSE\BUSSE_Programme\Gesamtprogramm_geschaeftlich\pgesamt1.exe'), nil, nil, 1);
Label1.Caption:='';
if RadioButton3.Checked=true then
ShellExecute(Form1.Handle, 'open', PChar('C:\Users\Jonas\Documents\BUSSE\BUSSE_Programme\Kalender\pKalender.exe'), nil, nil, 1);
Label1.Caption:='';
if (RadioButton2.Checked=false) and (RadioButton1.Checked=false) and (RadioButton3.Checked = false) then
Label1.Caption:='Bitte wählen Sie ein Adressbuch aus.';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ShellExecute(Form1.Handle, 'open', PChar('C:\Users\Jonas\Documents\BUSSE\BUSSE_Programme\Notfall\pNotfall.exe'), nil, nil, 1);
Memo1.Lines.Clear;
Image1.Picture.LoadFromFile('C:\Users\Jonas\Pictures\BUSSE\top1.bmp');
end;
end.
VIele Grüße
jonas_rotter1234