Hey

I was wondering how to generate a Windows popup in C. I mean by "Windows popup" as in (for example) when you do a net send message to a PC, a simple Windows popup comes up on the PC you sent the message to with the message. How can I generate one of those Windows popup messages in C? Tried looking for something on Google but only things like .NET, C++, and such come up. Thanks.

Maybe it works with the system command:

#include <stdio.h>
#include <stdlib.h>

int main()
{
/* not net send under vista, and msg is interactive*/
system("dir");
return 0;
}

Comments
No code tags, wrong code + system() == red dot.

To generate a popup, you have to use MFC . AND, The system() does not generate a pop-up in any way, as far as I know...

MessageBox(0,"Message body", "Message title", MB_OK ); might be what you're looking for. #include <windows.h> to use it.

Maybe it works with the system command:

#include <stdio.h>
#include <stdlib.h>

int main()
{
/* not net send under vista, and msg is interactive*/
system("dir");
return 0;
}

To generate a popup, you have to use MFC . ....

You both flunked the course because you are both wrong. Out of three responses to this question only one person got it correct.

Damn it is a shame that there is no standard function for it and it is only avaliable in Windows. Thanks anyhow :)

Hmm MessageBox(0,"Message body", "Message title", MB_OK ); doesnt work. Ive included windows.h but nothing. It complies with no errors and no warnings but just (blank program) tells me press any key to continue...

Hmm MessageBox(0,"Message body", "Message title", MB_OK ); doesnt work. Ive included windows.h but nothing. It complies with no errors and no warnings but just (blank program) tells me press any key to continue...

It worked ok for me. What compiler did you use? Mine is VC++ 2008 Express.

#include <windows.h>

int main()
{
    MessageBox(0,"Message body", "Message title", MB_OK );
}
Attachments Untitled.jpg 85.44 KB

I have got four tables namely sl #, Part #, description, qty. this should come in popup window and not only that kindly let me know how to use formula in the popup window.

This article has been dead for over six months. Start a new discussion instead.