The Windows form is a .NET application. It is not based directly on the native Windows API, but instead on the .NET framework. Which includes a virtual machine.
Win32 usually refers to the 32-bit Windows API. However, the _WIN32 macro _WIN32 defined for both 32-bit and 64-bit programming. As a type of Visual Studio project, it includes both GUI-level API programs and the console subsystem.
A Windows subsystem is a small integer value in the executable header that tells Windows what services this program requires. This value can be checked, for example, Microsoft dumpbin , for example. dumpbin c:\windows\notepad.exe /headers | find "ubs" dumpbin c:\windows\notepad.exe /headers | find "ubs" . On Windows 9x, dumpbin output was available through the file preview function, but this function was discontinued.
Each process in Windows can be associated with one and no more than one console window.
The GUI subsystem means that Windows will NOT attempt to merge each instance with its corresponding console window. However, the process can create a console window. Typically, this subsystem is used for ordinary programs with a graphical user interface (hence, the "GUI") and with most of the linkers that it indicated as "windows."
The console subsystem means that Windows will try to combine each instance with the corresponding console window, creating a new one if necessary.
note that
The same source code can be created as a console or graphical subsystem. And it is very easy to do. Just change the specification of the subsystem.
The GUI subsystem executable file has standard streams, as well as the console subsystem executable file.
The executable console subsystem can represent a graphical user interface, just like a graphical interface.
Also note that
- Microsoft tools by default will not accept the standard C ++
main for building the GUI subsystem. However, this inappropriate behavior is easy to fix. Just specify /entry:mainCRTStartup in the linker options.
There is no such problem with GNU tools, i.e. g ++.
source share