Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7596699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:58:53+00:00 2026-05-30T21:58:53+00:00

Ok this is a continuation from this question: How to make a simple Hello

  • 0

Ok this is a continuation from this question: How to make a simple Hello World "invisible" in Windows (C/C++)

People gave me some guidance and here I am with a new qestion:

Aight after doing some research I am stuck again. People on the internet claim that by just creating a win32 application there will be no graphical indications.

Here is the code that does this (I’m pretty sure you already know this but w/e)

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow) {

//code
return 0;
}

So the code typed inside main is not displayed. I don’t really get what kind of code they mean but for example:

#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow) {

    while (1) {
    }
}

This program pops a Cmd window just fine.

I’ve also found that by initializing values at the STARTUPINFO structure like that

STARTUPINFO StartupInfo;
memset(&StartupInfo, 0, sizeof(StartupInfo));
// set the size of the structure
StartupInfo.cb = sizeof(STARTUPINFO);
// tell the application that we are setting the window display 
// information within this structure
StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
// set the window display to HIDE
StartupInfo.wShowWindow = SW_HIDE;

would hide the console window. This doesn’t work either for me though. I have this feeling that I am missing a major concept here so I need your knowledge guys. I want to create simple .exe with something like a while loop or a simple print that doesn’t display a thing. What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:58:54+00:00Added an answer on May 30, 2026 at 9:58 pm

    You have to use a specific compiler option to do this; it’s not a property of the code itself. I will assume you are using Visual Studio to compile.

    Go to Project Properties > Configuration Properties > Linker > System > SubSystem and set it to Windows. If you do this and run your program and, for example, put your program into an infinite loop, you’ll have to kill it from the Task Manager.

    I have no idea how to do this on GCC. Gerald has told me in the comments that using --subsystem,windows or -mwindows will do this for GCC. Note that -mwindows links the GDI libraries as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a continuation from a previous stackoverflow question. I've renamed some variables so
As a continuation of this question I'm wondering if I can get some simple
This is a continuation question from a previous question I have asked I now
Ok - this is in continuation from my earlier question about sending an email
This is a continuation on this question : The problem is simple. I need
This question is a continuation of my last one, regarding How to make Ruby
This question is in continuation of this one . The deal is simple. Given:
This is a continuation question I had from a post yesterday: Initializing NSMutableDictionary (It's
In a continuation from this question . I'm trying to bind a given function
This is a continuation from an existing question. Javascript - Goto URL based on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.