Answers for "c++ cmd program run in background"

C++
0

c++ cmd program run in background

#include <windows.h>  
#include <iostream>     
using namespace std;


int main () {   
    cout<<"Some  information is displayed.. \n\n";
    Sleep(5000);

    cout<<"wait.. the console is going to hide and run in background.. \n";
    Sleep(5000);

    ShowWindow(FindWindowA("ConsoleWindowClass", NULL), false);

    while(true) {
                 // Do your hidden stuff in here
    }   
return 0;
}
Posted by: Guest on August-09-2021
1

how to run a c++ program in the background

HWND window;
AllocConsole();
window = FindWindowA("ConsoleWindowClass", NULL);
ShowWindow(window,0);
Posted by: Guest on April-04-2020

Browse Popular Code Answers by Language