Displays a message box with a choice of various buttons (or just an 'OK' button if not otherwise specified). Returns the button clicked on as a text string.
There is no need to call fhUpdateDisplay before calling this function, as there would be if you were using an IUP function to display a message box.
strButton = fhMessageBox(strMessage[,strMessageBoxFormat[,strMessageBoxIcon[, hParentWnd]]])
| MB_OK | OK Button Only |
|---|---|
| MB_ABORTRETRYIGNORE | 3 Buttons Abort,Retry and Ignore |
| MB_OKCANCEL | 2 Buttons OK and Cancel |
| MB_RETRYCANCEL | 2 Buttons Retry and Cancel |
| MB_YESNO | 2 Buttons Yes and No |
| MB_YESNOCANCEL | 3 Buttons Yes, No and Cancel |
| MB_ICONEXCLAMATION | ![]() |
|---|---|
| MB_ICONINFORMATION | ![]() |
| MB_ICONQUESTION | ![]() |
| MB_ICONSTOP | ![]() |
One of the following strings will be returned, based on the button pressed by the user:
| OK |
|---|
| Cancel |
| Abort |
| Retry |
| Ignore |
| Yes |
| No |
fhMessageBox("Hello World", "MB_OK", "MB_ICONEXCLAMATION") res = fhMessageBox("Do you wish to continue?", "MB_YESNO", "MB_ICONQUESTION") if res == "No" then fhMessageBox("You clicked No") elseif res == "Yes" then fhMessageBox("You clicked Yes") end
require("iuplua"); iup.SetGlobal("CUSTOMQUITMESSAGE","YES"); local btn = iup.button{title="click me"}; local dlg=iup.dialog{ iup.vbox{ iup.label{title="Hello"}, btn}, title="Test Click", size="200x200"}; iup.SetAttribute(dlg, "NATIVEPARENT", fhGetContextInfo("CI_PARENT_HWND")); function btn:action() local res = fhMessageBox("Hello world", "MB_OK", "", dlg.HWND) end iup.Popup(dlg); iup.Destroy(dlg);