run in background

Feb 14, 2014 at 9:13pm
Can i run my program in background
Last edited on Feb 14, 2014 at 9:44pm
Feb 14, 2014 at 9:14pm
Yes.
Feb 14, 2014 at 9:28pm
how
Feb 14, 2014 at 9:32pm
$my-program cmd args &
Feb 14, 2014 at 9:37pm
i dont understand
Feb 14, 2014 at 10:14pm
A method...

1
2
3
4
5
6
7
#include <Windows.h>

void HideConsole()
{
  HWND hWnd = GetConsoleWindow();
  ShowWindow( hWnd, SW_HIDE );
}
Last edited on Feb 14, 2014 at 10:14pm
Feb 14, 2014 at 10:47pm
If you don't need console I/O, you could mess with the Subsystem flag of the PE32 (change it to WINDOWS_GUI), and then Windows won't bother to attach a console to your program when it loads it.

Otherwise you'll have to do as HellfireXP suggests.


If you're using *nix let us know.
Topic archived. No new replies allowed.