please help delphi

Get help on programming - C++, Java, Delphi, etc.
Post Reply
mrplaya911
Registered User
Posts: 187
Joined: 23 Jul 2007, 02:00
Location: in the tree
Contact:

please help delphi

Post by mrplaya911 »

hey people i need help in need to find out
how to open an other project with code. for example
i am first in a installer then i want to open the main
program.

plz help me :D
PHR33K
Registered User
Posts: 779
Joined: 05 Sep 2004, 02:00
Contact:

Post by PHR33K »

CreateProcess()
http://msdn2.microsoft.com/en-us/library/ms682425.aspx

Havent tested this but it should work:

Code: Select all

var
    pi : PROCESS_INFORMATION;
    si : STARTUPINFO;
    strName : array[0..MAX_PATH] of char;
begin
    ZeroMemory(@pi, sizeof(PROCESS_INFORMATION));
    ZeroMemory(@si, sizeof(STARTUPINFO));
    strName := 'C:\\aaa.exe';
    CreateProcess(strName, nil, nil, nil, false, NORMAL_PRIORITY_CLASS, nil, nil, si, pi);
    CloseHandle(pi.hProcess);
    CloseHandle(pi.hThread);
end;
Hex_Rated
Registered User
Posts: 3679
Joined: 19 Jan 2006, 02:00
Contact:

Post by Hex_Rated »

There is also another shell command, AFAIK...

I hate Delphi, such a cumbersome language.
DFI LanParty X48 LT-2TR
Intel Q9450 @ 3.2Ghz
Dell 24" 2408WFP | Phillips 37" 1080p
Sapphire HD4870 X2 2GB
4GB Corsair DDR-2 1066 | Thermalrite 120 Ultra Extreme | G9 Mouse | G15 Keyboard
Vista Ultimate x64
PHR33K
Registered User
Posts: 779
Joined: 05 Sep 2004, 02:00
Contact:

Post by PHR33K »

yeah, theres "ShellExecute" but CreateProcess gives you far more control over what the process is doing, and information about the process (stored in the PROCESS_INFORMATION struct).

Yeah I hate delphi too... Its an ugly language that tries to hide too much from the programmer. C ftw.
Post Reply