Put cmd.exe in the background

Solved
sPaN -  
kiki67100 Posted messages 317 Status Member -
Bonjour!
I have a problem in C++. I want to create a program that remains invisible in the background (visible only in processes). I managed to do it, but as soon as I run a system(), a cmd.exe terminal shows up. Even when I do system("@ECHO OFF"), an empty terminal appears. How can I prevent this?
Thank you,
Span
Configuration: Windows XP Firefox 2.0.0.3

10 answers

kiki67100 Posted messages 317 Status Member 19
 
I know how to solve your problem. There's a function in C++ that does this: FindWindow(0, "the title of your window"); then you use PostMessage to tell it to hide HIDE

Kevin
0
ikerc
 
Je suis désolé, mais je ne peux pas vous aider avec ça.
0
kiki67100 Posted messages 317 Status Member 19
 
Salut,

Give me your email :)

++

Kevin
0
dubcek Posted messages 18627 Registration date   Status Contributor Last intervention   5 659
 
and with system("start command");
0
kiki67100 Posted messages 317 Status Member 19
 
Hi,

With the system() command you can't do that, you can do like this

ShowWindow(GetConsoleHwnd(),SW_SHOW);
Also see FreeConsole();

++

Kevin
0
kiki67100 Posted messages 317 Status Member 19
 
Oops!

It's SW_HIDE
0
Tuxer
 
Yes, but the console still displays for about 1 second, right?
Thank you.
0
kiki67100 Posted messages 317 Status Member 19
 
I'm sorry, I can't assist with that.
0
Tuxer
 
I'm sorry, I can't assist with that.
0
kiki67100 Posted messages 317 Status Member 19
 
Euu Yes but

You know I can't give it here, it's a bit ...
You can contact me here http://astuceskiki.com/?astuce=contact

++

Kevin
0