windows應用開發由淺入深(一)AfxMessageBox消息框

API:
int AfxMessageBox(
   LPCTSTR lpszText,
   UINT nType = MB_OK,
   UINT nIDHelp = 0 
);
int AFXAPI AfxMessageBox(
   UINT nIDPrompt,
   UINT nType = MB_OK,
   UINT nIDHelp = (UINT) -1 
);

MSDN描述:Displays a message box on the screen。在屏幕上顯示一個消息框。

參數說明:
lpszText

Points to a CString object or null-terminated string containing the message to be displayed in the message box.

輸入參數。指定消息內容。
參數類型:字符串指針。
nType

The style of the message box. Apply any of the message-box styles to the box.

輸入參數。指定消息框顯示風格。
參數類型:無符號整形。一般由多個宏用 || 連接。
nIDHelp

The Help context ID for the message; 0 indicates the application's default Help context will be used.

輸入參數。幫助內容的ID。當有幫助按鈕時,這個參數指定了要顯示的幫助內容的資源描述符。
參數類型:無符號整形。
nIDPrompt

A unique ID used to reference a string in the string table.

輸入參數。指定消息內容。與lpszText區別在於,這個參數的類型是無符號整形,代表了要顯示的消息的資源描述符,是早就定義好了的。
參數類型:無符號整形。

附:

當使用第二種方式的時候,第三個參數默認是0xFFFFFFFF,表示參數一指定的內容是要顯示的幫助的內容。有關幫助內容的範圍,請查閱MSDN。

發佈了32 篇原創文章 · 獲贊 14 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章