Win32API之MessageBox(转)

太之初一 posted @ 2016年6月13日 22:06 in Windows with tags c c++ 基础 Win32API , 1791 阅读

MessageBox 是Windows系统库 user32.dll 的一个导出函数,用于显示一个提示消息对话框,其原型定义如下 :

int MessageBox(

HWND hWnd, // handle to owner window

LPCTSTR lpText, // text in message box

LPCTSTR lpCaption, // message box title

UINT uType // message box style

);

可以看到有四个参数,第一个是消息框所有者窗口句柄,可以是NULL,第二个是消息框的文本内容,第三个是消息框标题,第四个参数是消息框样式(按钮和图标)。

 

按钮样式及常量(可用【样式=数字】表示)

0、确定按钮; _MB_OK=@0x0

1、确定、取消按钮; _MB_OKCANCEL=@0x1

2、终止、重试、忽略按钮;_MB_ABORTRETRYIGNORE=@0x2

3、是、否、取消按钮;_MB_YESNOCANCEL=@0x3

4、是、否按钮;_MB_YESNO=@0x4

5、重试取消钮;_MB_RETRYCANCEL=@0x5

6、终止、重试、继续           0x00000006(需声明API才能使用)

图标常量

_MB_ICONASTERISK=@0x40/ “i”图标

_MB_ICONEXCLAMATION=@0x30/ “!”号图标

_MB_ICONHAND=@0x10 / “×” 号图标

_MB_ICONINFORMATION=@0x40 / “i” 图标

_MB_ICONMASK=@0xF0 / “i” 图标

_MB_ICONQUESTION=@0x20/ “?” 号图标

_MB_ICONSTOP=@0x10/ “×” 号图标

 

按钮返回值

1=确定钮; IDOK

2=取消钮; IDCANCEL

3=终止钮; IDABORT

4=重试钮; IDRETRY

5=忽略钮;IDIGNORE

6=是钮;IDYES

7=否钮;IDNO  

Avatar_small
Odisha +2 Important 说:
2022年8月17日 21:22

Students can check the official website to get the New Question Paper in the first week of January 2023, whether it has been published or not. The education board in charge of Bit Bank Question PDFs, other exams, and the entire educational system is called the Odisha Board. The Board is in charge of advancing secondary education in the state of Odisha. Odisha The 12th Class New Question Paper will be announced in the month of January 2023 on the official website. <a href="https://www.li9.in/odisha-chse-question-paper-pdf/">Odisha +2 Important Question Paper 2023 PDF</a> CHSE 12 New Question Paper 2023, Orissa CHSE 12th Class New Question Paper 2023. Students who belong to The Odisha or Orissa State Board of School Education Board BSE And CHSE are informed that this will be the case.

Avatar_small
Odisha +2 Important 说:
2022年8月17日 21:23

Students can check the official website to get the New Question Paper in the first week of January 2023, whether it has been published or not. The education board in charge of Bit Bank Question PDFs, other exams, and the entire educational system is called the Odisha Board. The Board is in charge of advancing secondary education in the state of Odisha. Odisha The 12th Class New Question Paper will be announced in the month of January 2023 on the official website. Odisha +2 Important Question Paper 2023 PDF CHSE 12 New Question Paper 2023, Orissa CHSE 12th Class New Question Paper 2023. Students who belong to The Odisha or Orissa State Board of School Education Board BSE And CHSE are informed that this will be the case.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter