Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

convert a console app to a windows app

(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?

like image 217
Mick Avatar asked Oct 07 '10 17:10

Mick


People also ask

What is difference between console application and window application?

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.

What is console based application?

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 ...

How do I get the Visual Studio console App?

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.


2 Answers

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.

like image 101
Hans Passant Avatar answered Oct 03 '22 07:10

Hans Passant


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.

like image 45
Marc.2377 Avatar answered Oct 03 '22 07:10

Marc.2377