|
-
July 22nd, 2006, 12:32 PM
#1
launching a program without black DOS box
I tried system("c:\\....exe") and ShellExecute("c:\....exe") but both of them shows a black DOS box.. I want do launch the program directly
-
July 22nd, 2006, 12:35 PM
#2
Re: launching a program without black DOS box
first this shuld be in win32 forum .
second the block box is from the exe?
third tried createproccess?
-
July 22nd, 2006, 01:03 PM
#3
Re: launching a program without black DOS box
yes it is an exe file. How can I use createprocess?
-
July 22nd, 2006, 01:08 PM
#4
Re: launching a program without black DOS box
the black box is from the exe?
-
July 22nd, 2006, 02:28 PM
#5
Re: launching a program without black DOS box
Pass DETACHED_PROCESS as dwCreationFlags in CreateProcess.
http://msdn.microsoft.com/library/de...ateprocess.asp
Don't forget to call CloseHandle on both PROCESS_INFORMATION::hProcess and PROCESS_INFORMATION::hThread
"inherit to be reused by code that uses the base class, not to reuse base class code", Sutter and Alexandrescu, C++ Coding Standards.
Club of lovers of the C++ typecasts cute syntax: Only recorded member.
Out of memory happens! Handle it properly!
Say no to g_new()!
-
July 22nd, 2006, 02:33 PM
#6
Re: launching a program without black DOS box
-
July 23rd, 2006, 12:53 PM
#7
Re: launching a program without black DOS box
 Originally Posted by Mitsukai
the black box is from the exe?
no. it is a windows application.
-
July 23rd, 2006, 04:07 PM
#8
Re: launching a program without black DOS box
Maybe SW_HIDE in ShellExecute (not sure, didn't do Win API programming for some time).
"Programs must be written for people to read, and only incidentally for machines to execute."
-
August 9th, 2006, 04:42 AM
#9
Re: launching long path programs
I want to launch an application with path C:\Program Files\Firm Name\Program Name.exe. I think it does not work because path contains spaces
i tried system(c:\\program files\\firm name\\program name.exe);
also system(C:\\progra~1\firmna~1\progra~1.exe (not compiling));
-
August 9th, 2006, 05:44 AM
#10
Re: launching a program without black DOS box
Forgot ""? Also you should enclose it in "" in command line, to distinguish path to executable from its command line parameters, so it'll look this way:
Code:
system("\"C:\\Program Files\\Firm Name\\Program Name.exe\"");
(note \")
"Programs must be written for people to read, and only incidentally for machines to execute."
-
August 14th, 2006, 05:26 AM
#11
Re: launching a program without black DOS box
thank you it worked. also I found the total solution
to launch a windows program witout a black dos box, with parameters:
WinExec("C:\\Program Files\\My Application\\My App.exe C:\\foobar.tmp",SW_SHOWNORMAL)
-
August 14th, 2006, 05:50 AM
#12
Re: launching a program without black DOS box
It really works with spaces in directory names?
"Programs must be written for people to read, and only incidentally for machines to execute."
-
August 14th, 2006, 06:54 AM
#13
Re: launching a program without black DOS box
 Originally Posted by RoboTact
It really works with spaces in directory names?
Yep, that's a security flaw.
In order to avoid bugs written by bad programmers (especially Windows 3 programmers who assumed that most people don't put spaces in file names which was false, even in those early days), Windows first tries to search for a C:\Program.exe or C:\Program.com file, and if it doesn't exist, it tries C:\Program Files\My.exe (or .com), and then, C:\Program Files\My Application\My.exe (or .com), then, C:\Program Files\My Application\My App.exe. And, if it didn't exist, it would try C:\Program Files\My Application\My App.exe C:\foobar.tmp which is an invalid path, anyway.
This flaw can be exploited by malicious software.
"inherit to be reused by code that uses the base class, not to reuse base class code", Sutter and Alexandrescu, C++ Coding Standards.
Club of lovers of the C++ typecasts cute syntax: Only recorded member.
Out of memory happens! Handle it properly!
Say no to g_new()!
-
August 14th, 2006, 07:10 AM
#14
Re: launching a program without black DOS box
One more example of "silently accept buggy input" strategy - though with such approach something sloppy is simplier to make work it tends to stay at that sloppy level.
"Programs must be written for people to read, and only incidentally for machines to execute."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|