$newname = "New File"
$Form1=0
$save_file_dir = _FileSaveDialog("保存 文件 test 123 444", "", "配置文件 [*.ini](*.ini)|Txt File [*.txt](*.txt)|Data 文件 [*.dat](*.dat)|Config File [*.cfg](*.cfg)|其它文件 [*.*](*.*)", 2+16, $newname, "", $Form1)
MsgBox(0,"",$save_file_dir)
Func _FileSaveDialog ($sTitle, $sInitDir, $sFilter = 'All (*.*)', $iOpt = 0, $sDefaultFile = "", $sDefaultExt = "", $mainGUI = 0)
Local $iFileLen = 65536 ; 在返回的字符串中的最大字符数
; 准备 API 标志
Local $iFlag01 = BitAND ($iOpt, 2) ;位"与"运算
Local $iFlag02 = BitShift($iFlag01,-10) ;位"移"运算
Local $iFlag03 = BitAND($iOpt,16) ;位"与"运算
Local $iFlag04 = BitShift($iFlag03, 3) ;位"移"运算
Local $iFlag = BitOR($iFlag02, $iFlag04) ;位"或"运算
; 过滤字符串转换到数组
Local $asFLines = StringSplit( $sFilter, '|');分隔符拆分字串
Local $asFilter [$asFLines [0] *2+1]
Local $i, $iStart, $iFinal, $suFilter = ''
$asFilter [0] = $asFLines [0] *2
For $i=1 To $asFLines [0]
$iStart = StringInStr($asFLines [$i], '(', 0, 1) ;检查是否含有给定的子串
$iFinal = StringInStr($asFLines [$i], ')', 0,-1);检查是否含有给定的子串
$asFilter01 = StringLeft($asFLines [$i], $iStart-1) ;返回从左开始指定数量的字符
$asFilter [$i*2-1] = StringStripWS ($asFilter01, 3) ;删去所有"空白符".
$asFilter02 = StringTrimLeft($asFLines [$i], $iStart);删除从左开始指定数量的字符
$asFilter03 = StringLen($asFLines [$i]) ;返回字符总数
$asFilter04 = StringTrimRight($asFilter02, $asFilter03 -$iFinal+1);删除从右开始指定数量的字符
$asFilter [$i*2] = StringStripWS($asFilter04, 3) ;删去所有"空白符".
$suFilter01 = StringLen($asFilter [$i*2-1]);返回字符总数
$suFilter02 = StringLen($asFilter [$i*2]) ;返回字符总数
$suFilter = $suFilter & 'wchar[' & $suFilter01 + 1 & '];wchar[' & $suFilter02 + 1 & '];'
Next
; 创建 API 结构
Local $uOFN = DllStructCreate ('dword;int;int;ptr;ptr;dword;dword;ptr;dword' & _
';ptr;int;ptr;ptr;dword;short;short;ptr;ptr;ptr;ptr;ptr;dword;dword' )
Local $usTitle = DllStructCreate ('wchar[' & StringLen ($sTitle) +1 & ']')
Local $usInitDir= DllStructCreate ('wchar[' & StringLen ($sInitDir) +1 & ']')
Local $usFilter = DllStructCreate ($suFilter & 'wchar')
Local $usFile = DllStructCreate ('wchar[' & $iFileLen & ']')
Local $usExtn = DllStructCreate ('wchar[' & StringLen ($sDefaultExt) +1 & ']')
For $i=1 To $asFilter [0]
DllStructSetData ($usFilter, $i, $asFilter [$i])
Next
; 为 API 结构设置数据
DllStructSetData ($usTitle, 1, $sTitle)
DllStructSetData ($usInitDir, 1, $sInitDir)
DllStructSetData ($usFile, 1, $sDefaultFile)
DllStructSetData ($usExtn, 1, $sDefaultExt)
DllStructSetData ($uOFN, 1, DllStructGetSize($uOFN))
DllStructSetData ($uOFN, 2, $mainGUI)
DllStructSetData ($uOFN, 4, DllStructGetPtr ($usFilter))
DllStructSetData ($uOFN, 7, 1)
DllStructSetData ($uOFN, 8, DllStructGetPtr ($usFile))
DllStructSetData ($uOFN, 9, $iFileLen)
DllStructSetData ($uOFN, 12, DllStructGetPtr ($usInitDir))
DllStructSetData ($uOFN, 13, DllStructGetPtr ($usTitle))
DllStructSetData ($uOFN, 14, $iFlag)
DllStructSetData ($uOFN, 17, DllStructGetPtr ($usExtn))
DllStructSetData ($uOFN, 23, BitShift (BitAND ($iOpt, 32), 5))
; 调用 API 功能
$ret = DllCall ('comdlg32.dll', 'int', 'GetSaveFileNameW', 'ptr', DllStructGetPtr ($uOFN) )
If $ret [0] Then
Return DllStructGetData ($usFile, 1)
Else
SetError (1)
Return ""
EndIf
EndFunc
这样应该可以了..