How to remove show of the console window in the console app?
I made a simple programm for Total Commander which creates folders with names as format YYYY-MM-DD_HH-MM-SS.
I noticed when make it as 'PE CONSOLE', it works a little faster, but in this case I do not like the flashing console window. Can hide the window by configuring in the Total Commander, but I would like to remove it directly in the program (if it is, of course, possible).
There is no reason that a console app should be faster than one without. After all, the "console" thing is part of the PE format and is a single thing you have to change -- it is definitely not part of your "code". You can even change it manually with a Hex Editor.
Now of course it could be slower if your runtime adds a lot of stupid bloat and junk to the non-console version. Do you control the entry point of your application? You should. I don't have more info about it, so providing more info would help. Is it written in asm or C/C++ or something else?
You can still use e.g. C standard library (even from asm) without actually pulling that bloat into your executable, just link msvcrt.dll or whatever else you need and let it handle the symbol lookup. (note: if you use C compiler you'll have to pass some options, for GCC it is -nostdlib, to get full control over the entry point; main is NOT the entry point, it happens after a lot of bloat)
But yes, I need more info first on how you build your app
Oh, to add, if you want to "remove" the console window you need to turn it into a non-console application. This does not require changing your code but it could break. You need to change a byte only. I'm not sure if it will work, given the runtime initialization (if any?), you need to change the Subsystem field of this: https://msdn.microsoft.com/en-us/library/windows/desktop/ms680339%28v=vs.85%29.aspx (look online about PE format if you really want to do this "hack"; change it to 2 or IMAGE_SUBSYSTEM_WINDOWS_GUI, it should be set to 3 currently since it's console)
Perhaps you should check for resident software you have installed that injects its own nonsense to all starting GUI programs.
Hardly - it was tested on different PCs/OS (XP SP3 x86, Win 7 x86/x64, Win 8.1 x64) - everywhere the same behavior. Also for a long time already I do not use antiviruses, HIPS, etc., i.e. software that can cause similar effects.
Total Commander might not redraw its window immediately after you launch the app with GUI; but it will after the console since OS forces a refresh (because there was a window in the way, you know?). So that's why it could feel faster. In this sense, both are instant except one is just updated slower on your screen.
I know with Wine (on Linux) Total Commander doesn't redraw instantly many times, but it could be a wine thing of course.
Of course if you have another means to judge how fast it is other than the screen itself, then this isn't the issue. Can't say it happens here, sorry, so I'm stumped if so.
In vain I, probably, addressed this question - it was necessary to look first in google.
That there was no window it is necessary compile as GUI and nothing else.
There are at least two (FreeConsole, or GetConsoleWindow > ShowWindow,eax,SW_HIDE) ways to hide the window in the console app, but they are useless, since the program is already completing the task and ends, while the window is still blinking.
Thanks to everyone and sorry for disturbing.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum