You havn't provided enough info such as what compiler/development environment you are using; how you set up the project, etc. All these things matter. With most development system one must make an initial choice when setting up a project as to whether a console or GUI program is to be produced. There is no problem using one type and generating the other type in code, and vice versa. My guess is you've set up your project as a console project (hence the console window), then wrote (or copied) code to create a GUI window. So the solution to your problem isn't to get rid of the console window but to set up your project correctly so as not to produce it in the first place (assuming you don't want it, which you apparently don't).