Messagebox(handle,PChar(Err.message),'错误',mb_ok);

解决方案 »

  1.   

    try
      ...
    except
      on E: Exception do
        MessageBox(Handle, PChar('出错!请重新再试。' + #13 +
          Format('错误代码:%s', [E.Message])),
          '操作终止', MB_OK + MB_ICONSTOP);
    end; // try/except
      

  2.   

    不好意思,delphi的帮助上的
    MessageBox(
        HWND hWnd, // handle of owner window
        LPCTSTR lpText, // address of text in message box
        LPCTSTR lpCaption, // address of title of message box  
        UINT uType  // style of message box
       );
     ParametershWndIdentifies the owner window of the message box to be created. If this parameter is NULL, the message box has no owner window. lpTextPoints to a null-terminated string containing the message to be displayed. lpCaptionPoints to a null-terminated string used for the dialog box title. If this parameter is NULL, the default title Error is used. uTypeSpecifies a set of bit flags that determine the contents and behavior of the dialog box. This parameter can be a combination of flags from the following groups of flags. 
    Specify one of the following flags to indicate the buttons contained in the message box:Flag Meaning
    MB_ABORTRETRYIGNORE The message box contains three push buttons: Abort, Retry, and Ignore.
    MB_OK The message box contains one push button: OK. This is the default.
    MB_OKCANCEL The message box contains two push buttons: OK and Cancel.
    MB_RETRYCANCEL The message box contains two push buttons: Retry and Cancel.
    MB_YESNO The message box contains two push buttons: Yes and No.
    MB_YESNOCANCEL The message box contains three push buttons: Yes, No, and Cancel.
     Specify one of the following flags to display an icon in the message box:Flag Meaning
    MB_ICONEXCLAMATION, 
    MB_ICONWARNING
    An exclamation-point icon appears in the message box.
    MB_ICONINFORMATION, MB_ICONASTERISK
    An icon consisting of a lowercase letter i in a circle appears in the message box.
    MB_ICONQUESTION A question- icon appears in the message box.
    MB_ICONSTOP, 
    MB_ICONERROR, 
    MB_ICONHAND
    A stop-sign icon appears in the message box.
      

  3.   

    application.messagebox(pchar('你好 '+str),'信息提示',mb_OK+MB_ICONINFORMATION);//str为变量