Jayz
ISP
- Feb 17, 2002
- 59
Basically I just wanted to open an application that was stored within the same directory as my main application.
This was my original code:
procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(Handle, 'open','c:\lazy\calc.exe'
,nil, nil, SW_SHOWNORMAL)
end;
which simply runs calc.exe
But then I thought, what if I installed my application in say another drive like E:
So me thinks this code would work:
procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(Handle, 'open',(ExtractFilePath(Application.ExeName))+'\calc.exe
,nil, nil, SW_SHOWNORMAL)
end;
'lazy' being the dir where my main application is run from.
Well unfortunately this doesn't work.
any ideas?
This was my original code:
procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(Handle, 'open','c:\lazy\calc.exe'
,nil, nil, SW_SHOWNORMAL)
end;
which simply runs calc.exe
But then I thought, what if I installed my application in say another drive like E:
So me thinks this code would work:
procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(Handle, 'open',(ExtractFilePath(Application.ExeName))+'\calc.exe
,nil, nil, SW_SHOWNORMAL)
end;
'lazy' being the dir where my main application is run from.
Well unfortunately this doesn't work.
any ideas?