Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > Apps

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 07-21-2011, 06:59 PM
arwar arwar is offline
Member
 
Join Date: May 2010
Posts: 31
Default console app

how do i fire an app from within my console app?
Reply With Quote
  #2  
Old 07-21-2011, 09:12 PM
arwar arwar is offline
Member
 
Join Date: May 2010
Posts: 31
Default

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?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:06 AM.


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