Back to index

lightning-sunbird  0.9+nobinonly
showOSAlert.cpp File Reference
#include <stdio.h>
#include <string.h>
#include "nscore.h"

Go to the source code of this file.


void ShowOSAlert (const char *aMessage)

Function Documentation

void ShowOSAlert ( const char *  aMessage)

Definition at line 183 of file showOSAlert.cpp.

#ifdef DEBUG_dbragg
printf("\n****Inside ShowOSAlert ***\n"); 

    const PRInt32 max_len = 255;
    char message_copy[max_len+1] = { 0 };
    PRInt32 input_len = strlen(aMessage);
    PRInt32 copy_len = (input_len > max_len) ? max_len : input_len;
    strncpy(message_copy, aMessage, copy_len);
    message_copy[copy_len] = 0;

#if defined (XP_WIN)
    MessageBox(NULL, message_copy, NULL, MB_OK | MB_ICONERROR | MB_SETFOREGROUND );
#elif (XP_MAC)
    short buttonClicked;
    StandardAlert(kAlertStopAlert, c2pstr(message_copy), nil, nil, &buttonClicked);
#elif defined (MOZ_WIDGET_GTK)
    NS_gtk_alert(message_copy, NULL, "OK");
#elif defined (XP_OS2)
    /* Set our app to be a PM app before attempting Win calls */
    PPIB ppib;
    PTIB ptib;
    DosGetInfoBlocks(&ptib, &ppib);
    ppib->pib_ultype = 3;
    HAB hab = WinInitialize(0);
    HMQ hmq = WinCreateMsgQueue(hmq,0);
    WinMessageBox( HWND_DESKTOP, HWND_DESKTOP, message_copy, "", 0, MB_OK);
    // It can't hurt to display the message on the console in any case,
    // even if we have already tried to display it in a GUI window.
    fprintf(stdout, "%s\n", aMessage);

Here is the call graph for this function:

Here is the caller graph for this function: