Dlg [v5.02]

作者: majkinetor 最近更新时间: 20090930


This library contains some standard dialogs which are used often at another programs. They are not supported natively in AutoHotkey, so this library adds the possibilty to use them. In example we have missed in Ahk the Color and Font select dialog. Now we have them.

Dlg_callback(Handler,"","","")
Dlg_Color(ByRef Color, hGui=0)
Dlg_Find( hGui, Handler, Flags="d", FindText="")
Dlg_Font(ByRef Name, ByRef Style, ByRef Color, Effects=true, hGui=0)
Dlg_Icon(ByRef Icon, ByRef Index, hGui=0)
Dlg_Open( hGui=0, Title="", Filter="", DefaultFilter="", Root="", DefaultExt="", Flags="FILEMUSTEXIST HIDEREADONLY" )
Dlg_Replace( hGui, Handler, Flags="", FindText="", ReplaceText="")
Dlg_Save( hGui=0, Title="", Filter="", DefaultFilter="", Root="", DefaultExt="", Flags="" )

关于函数的参数和返回值, 请参阅其源码或 此文档.

备注

关于此函数(集)的更新细节和注意事项, 请参见 AutoHotkey 论坛: http://www.autohotkey.com/forum/topic17230.html

许可

此函数(集)是基于 BSD 许可的开源项目. 想了解许可详情, 请参见 http://creativecommons.org/licenses/BSD/

示例

; #Include Dlg.ahk
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

 ;basic usage
if Dlg_Icon(icon, idx := 4)
	msgbox Icon:   %icon%`nIndex:  %idx%

if Dlg_Color( color := 0xFF00AA )
	msgbox Color:  %color%

if Dlg_Font( font := "Courier New", style := "s16 bold underline italic", color:=0x80)
	msgbox Font:  %font%`nStyle:  %style%`nColor:  %color%

res := Dlg_Open("", "Select several files", "", "", "c:\Windows\", "", "ALLOWMULTISELECT FILEMUSTEXIST HIDEREADONLY")
IfNotEqual, res, , MsgBox, %res%

ExitApp