• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 267
  • Last Modified:

disable cmd window when execute .exe files

How can I disable the appearance of the dos window (cmd window)
whenever I invoke by system call an executable.

for instance system("notepad");

Rami.
0
rami_d
Asked:
rami_d
  • 2
1 Solution
 
mnashadkaCommented:
Don't use system.  I assume that you're on a Win32 platform.  Use CreateProcess to create the process, and then it will launch the process as you expected, as opposed to bringing up a DOS window.  Good luck.
0
 
mnashadkaCommented:
Example:
STARTUPINFO si = {0};
PROCESS_INFORMATION pi = {0};
si.cb = sizeof(si);

CreateProcess(NULL, "notepad.exe", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
0
 
rami_dAuthor Commented:
Thanks
0
 
bcladdCommented:
No comment has been added lately, so it's time to clean up this TA. I will
leave a recommendation in the Cleanup topic area that this question is:

Answered: Points to mnashadka: Grade A

Please leave any comments here within the next seven days.

Experts: Silence means you don't care. Grading recommendations are made in light
of the posted grading guidlines (http://www.experts-exchange.com/help.jsp#hi73).

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

-bcl (bcladd)
EE Cleanup Volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now