How can I run programs from an executable, and then close my program?
I.e.:
-my program opens
-runs program one
-immediately runs program two
-returns 0
How can I run programs from an executable, and then close my program?
I.e.:
-my program opens
-runs program one
-immediately runs program two
-returns 0
How you do this depends on your platform. Windows boxes can use ShellExecute or anything similar while Unix or Linux boxes would generally turn to the exec family of functions. A last resort option is the standard system function, but despite being available on all implementations, this function offers little in the way of advantages over less portable choices.
I'm using windows
Sorry about the double post...
How do I use ShellExecute?
Code:HINSTANCE ShellExecute( HWND hwnd, LPCTSTR lpOperation, LPCTSTR lpFile, LPCTSTR lpParameters, LPCTSTR lpDirectory, INT nShowCmd );
>>How do I use ShellExecute?
By visiting MSDN and reading the documentation and examples. Otherwise, why are they there?
I screwed around, and I almost got it working.
The problem is that it doesn't act like I opened it from the run dialog or the start menu... it pops up a window when normally it goes to the systrayCode:ShellExecute (NULL, "open", "C:\\Program Files\\Stardock\\ObjectBar\\ObjectBar.exe", NULL, NULL, 0); ShellExecute (NULL, "open", "C:\\Program Files\\Stardock\\DesktopX\\DesktopX.exe", NULL, NULL, 0); return 0;
Nevermind...
Code:ShellExecute (NULL, "open", "C:\\Program Files\\Stardock\\ObjectBar\\ObjectBar.exe", NULL, "C:\\PROGRA~1\\Stardock\\OBJECT~1", 0); ShellExecute (NULL, "open", "C:\\Program Files\\Stardock\\DesktopX\\DesktopX.exe", NULL, "C:\\PROGRA~1\\Stardock\\DesktopX", 0); return 0;