I just learned how to make message-boxes,
heres the code:
How do I do so the message-box comes up but not DOS?Code:#include <iostream.h>
int main()
{
MessageBox(NULL, "Message", "Title", MB_OK);
}
Printable View
I just learned how to make message-boxes,
heres the code:
How do I do so the message-box comes up but not DOS?Code:#include <iostream.h>
int main()
{
MessageBox(NULL, "Message", "Title", MB_OK);
}
Well first you have to include <windows.h> and your main should look like this
Code:#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, "Message", "Title", MB_OK);
return 0;
}
It didn't worked, DOS is still coming up :(
Code:#include <windows.h>
#include <iostream.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, "Message", "Title", MB_OK);
return 0;
}
change your linker options to not create an console window and you should be golden
Ok thanks for help :)
what compiler are you using?
I checked "länkare" (linker on swedish) and there it was "Don't open console window" thnx a lot
Your welcome :)