Beispiel #1
0
    /// <summary>
    /// Shows Error alert box with OK button.
    /// </summary>
    /// <param name="text">Main alert text / content.</param>
    /// <param name="caption">Message box title.</param>
    public void Error(string text, string caption)
    {
        try
        {
            int msgboxID = StaticPinvoke.MessageBox(GetWindowHandle(), text, caption, (uint)(0x00000006L | 0x00000010L));
            //Debug.Log(msgboxID);

            switch (msgboxID)
            {
            case 2:     //cancel
                Application.Quit();
                break;

            case 10:      //tryagain
                CheckMonitors();
                break;

            case 11:      //continue

                break;
            }
        }
        catch (Exception ex)
        {
            Debug.Log(ex.Message);
        }
    }
Beispiel #2
0
 /// <summary>
 /// Disclaimer Messagebox
 /// </summary>
 public int WarningMsg(string text, string caption)
 {
     try
     {
         int msgboxID = StaticPinvoke.MessageBox(GetWindowHandle(), text, caption, (uint)(0x00000001L | 0x00000030L));
         return(msgboxID);
     }
     catch (Exception ex)
     {
         Debug.Log(ex.Message);
         return(2);
     }
 }