Thanks to @robodesign for LOTS of collaboration, testing, and feedback. This is definitely a joint project.
Thanks to @just me for making TaskDialog which gave me some ideas in a few places I got stuck.
This class enhances and combines the Msgbox and InputBox commands.
Highlights:
Add as many custom buttons as you want.
Add a help button and specify an optional callback function.
Change text font, size, and color.
Change dialog background color.
Msgbox2 does quite a bit of auto-sizing for ease-of-use.
Specify any combo of height and width of display message.
Msgbox2 centers on specified parent window (if specified).
Msgbox2 can emulate modal functionality.
Specify x, y options to place the dialog anywhere you want.
.list row number selected in ListBox
.listText text of row number selected in Listbox
.dropList row number selected in DropDownList
.dropListText text of row number selected in DropDownList
.combo row number selected in ComboBox
.comboText text of row number selected in ComboBox
.check value of Checkbox (1 or 0 / true or false)
.button text of the button clicked
.ClassNN ClassNN of the button clicked
optimized / condensed code (managed to cut over 250 lines / 5000+ chars)
added optional callback function for help button
changed auto-sizing up a bit to be more intuitive
added options: x, y, width, height, margin
updated docs
modified options syntax to be more consistent though all options (check docs)
updated OP
2020/07/31:
changes for AHK v2-a119
moved AHK v2 listing to v2 forum
2020/05/19:
completely rewritten as a class
too many options to list, please read the help docs and comments!
output is now only as an object with properties
Output Properties: .list / .listText / .dropList / .dropListText / .combo / .comboText / .check / .button / .ClassNN
2020/05/04:
thanks to @robodesign for input, suggestions, and code examples!
added a DropDownList option list:item|item|item:default ... default = row number
added a checkbox option check:Don't show again.
refined code to get more consistent spacing, simplified options, help docs updated
msgbox is now centered on parent hwnd if specified
2020/04/25:
thanks to @robodesign for info about Critical and the fix
created custom GetMsgDimensions() in place of GetTextPixelsInternal()
fixed default button not getting focus
fixed selectable text being overlapped by buttons in some cases
added InputHook in place of While loop to wait for user input
2020/02/05:
added basic AHK color support for message color, and dialog background color
use "txtColor:cRed" / "txtColor:cFF0000" / "bgColor:Red" / "bgColor:FF0000"
specifying a blank value after the colon (:) uses the default system color
MsgBox2_AHK-master\AHK2\TheArkive_MsgBox2_Example.ahk (8) : ==> #Include file "_JXON.ahk" cannot be opened.
Thanks, that's what I'm looking for, but I have a problem of running the example. Where I can find _JXON.ahk?