(its a long story) but I have a large complex project file containing a windows program. Unfortunately the project was originally built as a console app. The program compiles and links ok but when runs brings up a console instead of the collection of windows I was hoping for. I looked at the command line and saw "/SUBSYSTEM:CONSOLE" whereas it should be "/SUBSYSTEM:WINDOWS". I have no idea how to change the command line. Is there some box I can tick in the project setting somewhere to make this change?
Console Applications don't have user interfaces and are run in the Command Prompt. Windows Forms applications do have user interfaces. That's probably the biggest difference. A Windows form application is an application that has a graphical user interface(GUI) like the Visual C# IDE.
A console application is a computer program designed to be used via a text-only computer interface, such as a text terminal, the command-line interface of some operating systems (Unix, DOS, etc.) or the text-based interface included with most graphical user interface (GUI) operating systems, such as the Windows Console ...
On the Create a new project page, enter console in the search box. Next, choose C# or Visual Basic from the language list, and then choose All platforms from the platform list. Choose the Console Application template, and then choose Next.
Right-click the project icon in the Solution Explorer, then Properties > Linker > System > SubSystem, and set that to Windows. You'll also have to change your main()
method to WinMain()
. And you'd better create some windows or there won't be much to look at.
Complementing Hans' answer: While under Properties, also remember to expand the C/C++ node and select Preprocessor. Then edit the Preprocessor Definitions - replace _CONSOLE
with _WINDOWS
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With