Post: [C++][Tutorial] Make applications run as a service
05-26-2011, 04:51 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); In C++ it is possible to hide the window and make the program run as a background service, luckily this is extremely easy to do.

First we add this as our first line of the program.

    
#define _WIN32_WINNT 0x0500


Then in our main() function, we add.

    
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_HIDE);


This will result in our program becoming hidden

Here we have an example application that will run in the background for 10 seconds doing nothing.

Originally posted by another user
You must login or register to view this content.


Enjoy. Smile

The following 3 users say thank you to Relevant for this useful post:

Josh_ox3, kiwimoosical, schnzrs
05-30-2011, 09:13 PM #2
Josh_ox3
Treasure hunter
How would i do this in C#, i have a really small knowledge of C++ =/ , good threads btw
05-30-2011, 09:57 PM #3
Originally posted by ox3 View Post
How would i do this in C#, i have a really small knowledge of C++ =/ , good threads btw


This is WinAPI specific, im not sure how to do it in C#, but it will be something to do with the first class you make, it might have an object somewhere to show/hide

The following user thanked Relevant for this useful post:

XxprokillahxX

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo