Common Operating System dialogs
| CmnDlg | Common Operating System dialogs |
| Color | |
| Find / Replace | |
| Font | |
| Icon | |
| Open / Save | |
| Examples | |
| About |


| hGui | Handle to parents HWND |
| fun | Notification function used for communication with dialog. |
| flags | Creation flags, see below. |
| deff | Default text to be displayed at the start of the dialog box in find edit box |
| defr | Default text to be displayed at the start of the dialog box in replace edit box |
String containing list of creation flags. You can use “-” prefix to hide that GUI field.
| d | down radio button selected in Find dialog |
| w | whole word selected |
| c | match case selected |
Dialog box is not modal, so it communicates with the script while it is active. Both Find & Replace use the same prototype of notification function so even if you use Find only you will have to specify ReplaceWith parameter.
OnFind(Event, Flags, FindWhat, ReplaceWith)
| Event | ”close”, “find”, “replace”, “replace_all” |
| Flags | string contaning flags about user selection; each letter means user has selected that particular GUI element. |
| FindWhat | user find text |
| ReplaceWith | user replace text |
Handle of the dialog or 0 if dialog can’t be created. Can also return “Invalid Label” if lbl is not valid.
CmnDlg_Font( ByRef pFace, ByRef pStyle, ByRef pColor, pEffects = true, hGui = 0 )
| pFace | Initial font, output |
| pStyle | Initial style, output |
| pColor | Initial text color, output |
| pEffects | Set to false to disable effects (strikeout, underline, color) |
| hGui | Parent’s handle, affects position |
False if user canceled the dialog or if error occurred
CmnDlg_Icon( ByRef sIcon, ByRef idx, hGui = )
| sIcon | Default icon resource, output |
| idx | Default index within resource, output |
| hGui | Optional handle of the parent GUI. |
False if user canceled the dialog or if error occurred
This is simple and non-fleixibile dialog. If you need more flexibility, use <IconEx> instead.

| hGui | Parent’s handle, positive number by default 0 (influences dialog position) |
| Title | Dialog title |
| Filter | Specify filter as with FileSelectFile. Seperate multiple filters with “|”. For instance “All Files (.)|Audio (*.wav; *.mp2; *.mp3)|Documents (*.txt)” |
| DefultFilter | Index of default filter, by default 1 |
| Root | Specifies startup directory and initial content of “File Name” edit. Directory must have trailing “\”. |
| DefaulltExt | Extension to append when none given |
| Flags | White space separated list of flags, by default “FILEMUSTEXIST HIDEREADONLY” |
| allowmultiselect | Specifies that the File Name list box allows multiple selections |
| createprompt | If the user specifies a file that does not exist, this flag causes the dialog box to prompt the user for permission to create the file |
| dontaddtorecent | Prevents the system from adding a link to the selected file in the file system directory that contains the user’s most recently used documents. |
| extensiondifferent | Specifies that the user typed a file name extension that differs from the extension specified by defaulltExt |
| filemustexist | Specifies that the user can type only names of existing files in the File Name entry field |
| forceshowhidden | Forces the showing of system and hidden files, thus overriding the user setting to show or not show hidden files. However, a file that is marked both system and hidden is not shown. |
| hidereadonly | Hides the Read Only check box. |
| nochangedir | Restores the current directory to its original value if the user changed the directory while searching for files. |
| nodereferencelinks | Directs the dialog box to return the path and file name of the selected shortcut (.LNK) file. If this value is not specified, the dialog box returns the path and file name of the file referenced by the shortcut. |
| novalidate | Specifies that the common dialog boxes allow invalid characters in the returned file name |
| overwriteprompt | Causes the Save As dialog box to generate a message box if the selected file already exists. The user must confirm whether to overwrite the file. |
| pathmustexist | Specifies that the user can type only valid paths and file names. |
| readonly | Causes the Read Only check box to be selected initially when the dialog box is created |
| showhelp | Causes the dialog box to display the Help button. The hGui receives the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button. |
| noreadonlyreturn | Specifies that the returned file does not have the Read Only check box selected and is not in a write-protected directory. |
| notestfilecreate | Specifies that the file is not created before the dialog box is closed. This flag should be specified if the application saves the file on a create-nonmodify network share. |
Selected FileName or Emtpy when cancelled. If more then one file is selected they are separated by new line character.
;basic usage
if CmnDlg_Icon(icon, idx := 4)
msgbox Icon: %icon%`nIndex: %idx%
if CmnDlg_Color( color := 0xFF00AA )
msgbox Color: %color%
if CmnDlg_Font( font := "Courier New", style := "s16 bold underline italic", color:=0x80)
msgbox Font: %font%`nStyle: %style%`nColor: %color%
res := CmnDlg_Open("", "Select several files", "", "", "c:\Windows\", "", "ALLOWMULTISELECT FILEMUSTEXIST HIDEREADONLY")
IfNotEqual, res, , MsgBox, %res%
return;create gui and set text color CmnDlg_Font( font := "Courier New", style := "s16 bold italic", color:=0xFF) Gui Font, %Style% c%Color%, %Font% Gui, Add, Text, ,Hello world..... :roll: Gui, Show, Autosize return
CmnDlg_Color( ByRef pColor, hGui = )
CmnDlg_Font( ByRef pFace, ByRef pStyle, ByRef pColor, pEffects = true, hGui = 0 )
CmnDlg_Icon( ByRef sIcon, ByRef idx, hGui = )