Delphi Pages Forums

Delphi Pages Forums (http://www.delphipages.com/forum/index.php)
-   Apps (http://www.delphipages.com/forum/forumdisplay.php?f=8)
-   -   console app (http://www.delphipages.com/forum/showthread.php?t=210400)

arwar 07-21-2011 06:59 PM

console app
 
how do i fire an app from within my console app?

arwar 07-21-2011 09:12 PM

i figured out a solution myself. what was hanging me up was that i couldn't get shellexecute past the compiler. it didn't like the handle argument and i don't where it is defined in Delphi to add the unit to uses clause.

here is the code:

program up_it;
{$APPTYPE CONSOLE}
uses
SysUtils, shellapi, windows, dialogs;

begin

sleep(500);
if fileexists('test.exe') then begin
deletefile('sao.exe');
renamefile('test.exe','sao.exe');
shellexecute(0,'open',pansichar('sao.exe'),nil,nil ,sw_shownormal);
end
else showmessage('no file test.exe found');
end.

i changed the first param in shellexecute from 'handle' to '0' and off it went. anybody have anything else to add?


All times are GMT. The time now is 10:33 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.