Cmd window

how do i get rid of it in a win32 app?

Page 1 of 1

10 Replies - 835 Views - Last Post: 31 May 2009 - 02:32 AM Rate Topic: -----

#1 DingleNutZ  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 121
  • Joined: 02-May 09

Cmd window

Post icon  Posted 28 May 2009 - 08:45 PM

just a quick question, how do i get rid of the command window in the back of a win32 app?

heres some quick source code to play round with (use it if you want for your own purposes)

#include <windows.h>
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){
	do{MessageBox(NULL, "hi", "hi", 0);} while (1<2);
}



thanx for any help in advanced.


P.S what do you think of my awesome code?

Is This A Good Question/Topic? 0
  • +

Replies To: Cmd window

#2 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5364
  • View blog
  • Posts: 27,325
  • Joined: 10-May 07

Re: Cmd window

Posted 28 May 2009 - 08:47 PM

You either compile your project as a Windows Application, or a Console Application. What IDE are you using?
Was This Post Helpful? 0
  • +
  • -

#3 DingleNutZ  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 121
  • Joined: 02-May 09

Re: Cmd window

Posted 28 May 2009 - 08:48 PM

Bloodshed Dev-C++.
my most favouriteist
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5364
  • View blog
  • Posts: 27,325
  • Joined: 10-May 07

Re: Cmd window

Posted 28 May 2009 - 08:50 PM

Quote

The most useful of these for general programming are on the initial Project tab:

* Windows Application - a skeleton Win32 application
* Console Application - just a main function and useful includes
* DLL - for creating dynamic link libraries

When you started your project, did you see these options? Chances are, you zigged when you should have zagged.
Was This Post Helpful? 0
  • +
  • -

#5 DingleNutZ  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 121
  • Joined: 02-May 09

Re: Cmd window

Posted 28 May 2009 - 08:52 PM

i did it from scratch, i wanted to learn the actually code instead of short cutting. but is there any code or sumthin to get rid of it without changing what actually happens (a repeating messagebox)
Was This Post Helpful? 0
  • +
  • -

#6 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5364
  • View blog
  • Posts: 27,325
  • Joined: 10-May 07

Re: Cmd window

Posted 28 May 2009 - 09:02 PM

Then you'll need to code the entire Windows Listener loop. Not just a message box :) You'll need to setup the dimensions to the window, the icons, the mouse pointer. All of the rc values, basically. You'll setup the loop & then handle the results.
Was This Post Helpful? 0
  • +
  • -

#7 DingleNutZ  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 121
  • Joined: 02-May 09

Re: Cmd window

Posted 28 May 2009 - 09:05 PM

for real?, no just typing in "kill_cmd" ?
Was This Post Helpful? 0
  • +
  • -

#8 nirvanarupali  Icon User is offline

  • D.I.C Stomach
  • member icon

Reputation: 13
  • View blog
  • Posts: 1,119
  • Joined: 01-August 07

Re: Cmd window

Posted 28 May 2009 - 09:35 PM

View PostDingleNutZ, on 29 May, 2009 - 10:45 AM, said:

just a quick question, how do i get rid of the command window in the back of a win32 app?

heres some quick source code to play round with (use it if you want for your own purposes)

#include <windows.h>
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){
	do{MessageBox(NULL, "hi", "hi", 0);} while (1<2);
}



thanx for any help in advanced.


P.S what do you think of my awesome code?



Your codes is working fine to me, I'm using Borland C++ 5.5. I have no command window.

You have to compile your codes as windows application.
Was This Post Helpful? 0
  • +
  • -

#9 DingleNutZ  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 121
  • Joined: 02-May 09

Re: Cmd window

Posted 28 May 2009 - 09:43 PM

how did you close it without the CMD? lol
Was This Post Helpful? 0
  • +
  • -

#10 nirvanarupali  Icon User is offline

  • D.I.C Stomach
  • member icon

Reputation: 13
  • View blog
  • Posts: 1,119
  • Joined: 01-August 07

Re: Cmd window

Posted 29 May 2009 - 05:10 PM

Well I revised it, I removed the infinite loop. :blink:

#include <windows.h>
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){
	MessageBox(NULL, "hi", "hi", 0);
}




Is it not the same?
Was This Post Helpful? 0
  • +
  • -

#11 DingleNutZ  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 121
  • Joined: 02-May 09

Re: Cmd window

Posted 31 May 2009 - 02:32 AM

u edit my code!!!!, u go to hell!!!!.
kidding lol, :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1