Windows hello word program

Unposible first program in windows enviorment and its not working
Can anyone tell me whats wrong?
Im using dev c++ g++ compiler?
code is below :
1
2
3
4
5
6
#include <windows.h>
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR IpCmdLine, int iCmdShow)
{
    MessageBox (NULL, "Hello windows!", "Wellcome message", MB_OK|MB_ICONEXCLAMATION);
    return 0;
}


Maybe I need some parameters that tell compiller to compilling as windows app?
I just guessing...
Tnx for help
You should make a win32 project, and btw; what error are you getting?
when I run program it stars but instead of show onlx massage box show Console window and message box program should show just message box without console window
Well, Dev-C++ asks you when you create a project whether you want a consoile mode project or a GUI project. You need to choose GUI project (or whatever the other selection is besides console project - I forget).

If by some chance you are bypassing the project setup step and just pasting in code into a blank file without setting up a project at all, then it might default to creating a console project. In that case yoyu would get both a message box and a console.
tnx
Topic archived. No new replies allowed.