问题
How can you write a C++ program to open a window like this one...

Is it possible or can apps only be ran from the command line?
I'm using the G++ compiler... Do I need something else like visual studio?
Can I do it just by writing code?
回答1:
Take a look at Qt which is a cross-platform framework that easily builds GUIs.
Then check out a Qt tutorial, do a google search. Here is one that will get you to "hello world"
Also, you might want to check out Code::Blocks as an IDE. It will use your already installed g++ compiler.
回答2:
You can use Borland C++, Visual C++ they has GUI or wxWindow or GTK library.
回答3:
GUI programming requires the use of additional libraries. There is a C++ GUI library supplied by Microsoft for Windows called MFC. There are many other GUI libraries out there.
If you use these GUI libraries, you don't need to run the application from the command line.
回答4:
Search for WinApi Tutorials like this one
there are alot or you can also you the Visual Studio MFC application wizard and create a dialog application
回答5:
Microsoft provides a tuturial for doing that:
http://msdn.microsoft.com/en-us/library/bb384843.aspx
回答6:
You need to use the Windows api from within C++.
来源:https://stackoverflow.com/questions/3567182/c-open-window-hello-world