How do I display a popup window in a Win32 Console application in Microsoft Visual C++? This is for building a drowsiness detection system using OpenCv.
MessageBox( nullptr, TEXT( "The driver is sleeping!!" ), TEXT( "Message" ), MB_OK );
Make sure to include windows.h. The thread you call this on will block.
#include <windows.h> 
int main() { 
        MessageBox(NULL, L"The message", L"The caption", MB_OK);
        return 0; 
} 
remember to link with user32.lib
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With