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?