在你的CPP文件中加上:#include <windows.h>
然后直接使用,具体的使用方法有点和MFC的MessageBox不太相似,你可以查找MSDN中的信息。

解决方案 »

  1.   

    int MessageBox(
      HWND hWnd,          // handle to owner window
      LPCTSTR lpText,     // text in message box
      LPCTSTR lpCaption,  // message box title
      UINT uType          // message box style
    );比如这样:if (MessageBox(hwndDlg, SZNOTFOUND, SZDELETEITEM,MB_OKCANCEL)==IDOK) 
        {
            //do sth     }
      

  2.   

    如:
    #include "windows.h"
    。。
    MessageBox(NULL,"你好!",NULL,MB_OK);
      

  3.   

    #include <windows.h>
    int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow )
    {
      MessageBox( NULL, "It is OK.", "Like this", 0 );  return 0;
    }
      

  4.   

    int MessageBox(
      HWND hWnd,          // 拥有对话框的窗口的句柄  
      LPCTSTR lpText,    // 消息
      LPCTSTR lpCaption,  // 标题
      UINT uType          // 样式
    );hWnd 可以是NULL