setting the optimization: strip all symbols from binary changed my 718 KB .exe file into a 7 KB .exe file? how this?
This is not an optimisation. The executable has no debug symbols, so it is smaller.
the funny thing is that when i choose the build target: debug , then the size of the .exe is 715 kb
but when i choose the build target: release, then the size of the .exe is 7 kb.
This target (by the default project wizard) enables stripping debug info.
But when i use the left settings and rebuild the project the .exe file is still only 7 kb so no optimization has happened at all???
There is little or no opportunity to optimise a program that opens a window. You may want to search the internet about what compiler optimisations are about.
Also, there is a minimum program size due to both runtime overhead and the PE format. If you really need a program file that is smaller than 7 kB (which is quite ridiculous) then you can waste your time and use the same tricks that those people making "4k demos" use. You will have to resort to assembler, though.
How can ONE single visible windows consume a half MEGABYTE of RAM?
The correct question would be: "why do I care about it?". But to answer your question: there is a minimum overhead that every running process consumes for such things as stack and heap. You can tweak these with some compiler settings or by modifying the PE header directly, but again, why would one want to do that...
Also the memory (application and system RAM, and video memory) necessary to manage a window may be considerable and well beyond your scope, depending on the actual program code, and on what you configure Windows or your display drivers to do.
Little of all this seems related to Code::Blocks to me.