wb_message_box

int wb_message_box (int parent, string message [, string title [, int style]])

Creates and displays a message box and returns a value according to the button pressed.

Return values

Pressing either button Cancel, No, Ignore or Abort will return FALSE; Pressing OK, Yes or Retry will return TRUE; If the function is not successful it will return NULL.

Message box styles

WBC_INFO
WBC_OK
WBC_OKCANCEL
WBC_QUESTION
WBC_STOP
WBC_WARNING
WBC_YESNO
WBC_YESNOCANCEL

Example

// Asks for confirmation before closing an application window

function process_main($window, $id)
{ 
   switch($id) { 
       case ID_EXIT: 
       case IDCLOSE: 
           if(wb_message_box($window, "Are your sure?", APPNAME, WBC_YESNO)) 
               wb_destroy_window($window); 
           break;
   }
}

See also

Dialog functions