User forums > Help
WINAPI program has DOS window
serverul:
hi,
I wrote a very simple program in c using windows.h and when I compile it and run it I get a DOS window and them my windows message box
--- Code: ---#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
MessageBox(NULL, "Good Morning", "BOO!!!", MB_OK);
return 0;
}
--- End code ---
this is the code though I think it's irelevant, and I tryed compiling the code in Visual c++ and I don't get the DOS window there.
Can anyone pls tell me how to get rid of that?
ty
dje:
Hi !
Did you chose the right project template (Win32 GUI project) to build your exe?
Dje
Jenna:
The debug-version uses afaik a dos-window.
serverul:
--- Quote from: jens on June 29, 2008, 10:15:52 am ---The debug-version uses afaik a dos-window.
--- End quote ---
ty ;) I modified my project to be for relese only and I got rid of that DOS window ;)
Biplab:
--- Quote from: serverul on June 29, 2008, 09:41:05 am ---...
Can anyone pls tell me how to get rid of that?
--- End quote ---
Add -mwindows to linker options.
Navigation
[0] Message Index
[#] Next page
Go to full version