MessageBox('This should be on top.', 'Look', MB_OK);
应该是这样写的,这可是从DELPHI帮助找到的例子哟!

解决方案 »

  1.   

    Drate(小虫) :
    你说的是 Application.MessageBOx函数,我想用的是Win32 APIS函数!!
      

  2.   

    MessageBox(Form1.Handle,PChar('OK'),PChar('OK'),0);这样就正常了!!第一个参数不能为NULL吗?可是在VC中是可以的啊??请大侠给指点一下!
      

  3.   

    MessageBox(Form1.Handle,PChar('OK'),PChar('OK'),0);这句代码绝对错误,
    ‘ok’默认就是Pchar字符串,你还给前面加Pchar干啥?
      

  4.   

    zhang21cnboy(沧桑男人)
    是吗?可是这样也可以运行啊?
    但是我想问的是为什么第一个参数是NULL就不行?
      

  5.   

    第一个参数是handle,是无符号整型,当然不能传Null了,再说指针应该传nil,而不是null
      

  6.   

    application.messagebox('提示信息','标题栏提示信息',mb_yesno+mb_iconquestion);
        _______  _______________
        组合键    提示用的图标
    关于组合键和提示用的图标请参阅:
    Value MeaningMB_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.MessageBox returns 0 if there isn抰 enough memory to create the message box. Otherwise it returns one of the following values:Value Numeric value MeaningIDOK 1 The user chose the OK button.
    IDCANCEL 2 The user chose the Cancel button.
    IDABORT 3 The user chose the Abort button.
    IDRETRY 4 The user chose the Retry button.
    IDIGNORE 5 The user chose the Ignore button.
    IDYES 6 The user chose the Yes button.
    IDNO 7 The user chose the No button.
    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.
      

  7.   

    不用那么烦:如下
    MessageBox(handle,'ok','title',MB_OK)