what is the difference between win32 application,

2019-03-20 15:31发布

I want to know what is the difference between windows form application, win32application ana console, i know that both the windows form application and win32 application is gui tool, but i want to know when to use one over the other one, and could I convert console application to windows form application ?

3条回答
forever°为你锁心
2楼-- · 2019-03-20 15:51

Windows Form refers to a .NET application. It's not based directly on the native Windows API, but instead on the .NET infrastructure. Which includes a virtual machine.

Win32 generally refers to the 32-bit Windows API. However, the _WIN32 macro is defined for both 32-bit and 64-bit programming. As a Visual Studio project type it includes both GUI and console subsystem API-level programs.

A Windows subsystem is a small integer value in the executable's header that tells Windows what kind of services this program needs. This value can be inspected via e.g. Microsoft's dumpbin program, e.g. dumpbin c:\windows\notepad.exe /headers | find "ubs". In Windows 9x the dumpbin output was available via the file preview functionality, but that feature was discontinued.

Each process in Windows can be associated with one, and at most one, console window.

GUI subsystem means that Windows will NOT attempt to outfit each instance with an associated console window. The process can however create a console window itself. Usually this subsystem is used for ordinary programs with a graphical user interface (hence, "GUI"), and with most linkers it's specified as "windows".

Console subsystem means that Windows will attempt to outfit each instance with an associated console window, creating a new one if necessary.

Note that

  • The same source code can be built as console or GUI subsystem. And that's extremely easy to do. Just change the subsystem specification.

  • A GUI subsystem executable has standard streams, just as a console subsystem executable has.

  • A console subsystem executable can present a graphical user interface, just as a GUI one can.

Also note that

  • Microsoft's tools will by default not accept a standard C++ main for a GUI subsystem build. However, this non-conforming behavior is easy to fix. Just specify /entry:mainCRTStartup in the linker options.

There is no such problem with the GNU tools, that is, g++.

查看更多
老娘就宠你
3楼-- · 2019-03-20 16:06

A "windows form application" is a GUI .NET app.

A "win32 application" is a native Windows GUI app.

A "console application" is a native app without GUI.

I don't really understand what you exactly mean by "convert" one kind of app to another kind. But. If you are talking about using some IDE and convert a project to another one : YES it is possible. What makes the main difference is the .DLLs you linked your app with. You can configure a project opened as "console" to behave as a "win32" for example. It is not really easy, but it remains possible. Nos if you want to know if a given existing application that you installed can be converted : NO.

查看更多
贼婆χ
4楼-- · 2019-03-20 16:07
  1. windows form applications are applications that use the graphical programming interface frameworks such as .NET, DELPHI, or MFC instead of directly calling the win32 API.
  2. On the other hand, win32 application usually deals directly with windows api to create applications from bottom up.
  3. And console applications don't have any graphical interface. Only command line window is used for data input and result output.
查看更多
登录 后发表回答