Delphi Application.MessageBox detailed explanation

Delphi Application.MessageBox detailed explanation

Detailed Application.MessageBox
Arguments:
1. Text: the message to be displayed
2. Caption: the text of the title bar of the message window
3. Flags: the message flag
     3.1. The icon on the
     message window can be designated 3.2. The button that appears in the message window
     can be designated 3.3. Focus in which a preset button
     . 3.4 specify whether Modal
     3.5 other.
arguments Description:
Text, Caption argument is PCahr type, string type variables available PChar ()
conversion, if directly into a string, then it No need to transform.
For example:
var s: string;
....
s :='Archive failed'; 
Application.MessageBox(PChar(s),'error', MB_ICONERROR);
Flag parameter is of Longint type, and the available incoming values ​​are:
1 . The icon on the designated message window
1.1 MB_ICONEXCLAMATION or MB_ICONWARNING shows the icon of
      "An exclamation mark in a yellow triangle"
1.2 MB_ICONINFORMATION or MB_ICONASTERISK shows the icon of
      "A small blue i in a white oval"
1.3 MB_ICONQUESTION
      appears with a "question mark" icon
1.4 MB_ICONSTOP or MB_ICONERROR or MB_ICONHAND
      appears with a "red X" icon
2. Buttons that appear in the designated message window
2.1 MB_ABORTRETRYIGNORE
      appears with three buttons "Abort", "Retry" and "Ignore"
2.2 MB_OK
      appears with "Ok" Button, the default value.
2.3 MB_OKCANCEL
      appears with two buttons “Ok” and “Cancel”
2.4 MB_RETRYCANCEL
      appears with two buttons “Retry” and “Cancel”
2.5 MB_YESNO
      appears with two buttons “Yes” and “No”
2.6 MB_YESNOCANCEL
      appears with three buttons “Yes”, “No” and “Cancel” Button
3. You can specify which button the preset Focus is on.
3.1 MB_DEFBUTTON1
      specifies that the focus is the first button on the left, which is the default value.
3.2 MB_DEFBUTTON2, MB_DEFBUTTON3, MB_DEFBUTTON4
      and so on, specify the focus on the second, third, and fourth buttons on the left
4. It can be specified whether Modal
4.1 MB_APPLMODAL 
      is a modal form for the application.
4.2 MB_SYSTEMMODAL
      for the operating system.
4.3 MB_TASKMODAL
      for the task.
      Generally speaking, this is equivalent to MB_APPLMODAL. but when all applications in the
     form are hidden when you must use this in order to achieve the purpose of the modal
5. other
5.1 MB_TOPMOST
      will be raised to the top of the message window
5.2 MB_RIGHT
      align the text of the message to the right
in a Flag to specify so much How can I use it?
As long as the parameters to be used are combined or together. For example:
Application.MessageBox(PCahr(sMsg), PChar(sCap), MB_YESNO or MB_ICONQUESTION or MB_DEFBUTTON2)
so there will be "a question mark" icon, "Yes" "No" two buttons, but also focus on the No button to
return value :
1. IDABORT: The user pressed the "Abort" button
2. IDCANCEL: the user pressed the "Cancel" button
3. IDIGNORE: the user pressed the "Ignore" button
4. IDNO: the user pressed the "No" button
5. IDOK: the user pressed the "Ok" button
6. IDRETRY: users press the "Retry" button
7. IDYES: users press the "Yes" button
Incidentally, the text on the button with the language will change the operating system, and, on the Chinese version of the Windows button The text appears in Chinese.

Reference : https://blog.csdn.net/yfy_47/article/details/7428301