Please support our Pascal and Delphi advertiser: Programming Forums
Views: 3354 | Replies: 5
![]() |
•
•
•
•
| |
•
•
Join Date: Aug 2005
Posts: 20
Reputation:
Rep Power: 4
Solved Threads: 0
Hi,
I have an answer to 'how to execute an external exe file'.
Under 'implementation' and before your first procedure type in 'uses ShellAPI;'
After typing that in, add the following code to one of your procedures:
ShellExecute(Handle, 'open', 'type in the directory of your file e.g. c:\test.txt', nil, nil, SW_SHOWNORMAL);
Hope that helps
I have an answer to 'how to execute an external exe file'.
Under 'implementation' and before your first procedure type in 'uses ShellAPI;'
After typing that in, add the following code to one of your procedures:
ShellExecute(Handle, 'open', 'type in the directory of your file e.g. c:\test.txt', nil, nil, SW_SHOWNORMAL);
Hope that helps
•
•
Join Date: Jan 2008
Posts: 30
Reputation:
Rep Power: 1
Solved Threads: 0
This works fine, but how can I replace the string of the file to execute by my string.
I have:
Var
txt : string;
.
.
txt := 'myprogram.exe'
.
.
ShellExecute(Handle, 'open', txt, nil, nil, SW_SHOWNORMAL);
This gives a compile error:
Incompatible types: 'String' and 'PAnsiChar'
How can I conver my string to PAnsiChar?
I have:
Var
txt : string;
.
.
txt := 'myprogram.exe'
.
.
ShellExecute(Handle, 'open', txt, nil, nil, SW_SHOWNORMAL);
This gives a compile error:
Incompatible types: 'String' and 'PAnsiChar'
How can I conver my string to PAnsiChar?
•
•
Join Date: Aug 2008
Posts: 1,003
Reputation:
Rep Power: 4
Solved Threads: 95
You can convert it like any other conversion with pansichar(txt) or, you could have made the variable an ansichar and sent the pointer..
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
•
•
Join Date: Oct 2008
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
If just launch a new app then use ShellExecute, then you can hide them or hide your app to enable auto setup
------------------------------------
Self Cert best acne solution products
------------------------------------
Self Cert best acne solution products
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Hybrid Mode