找到了一个方法。如下。OK了。
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
Opt('MustDeclareVars', 1)
Global $iMemo
_Example_Defaults()
_Example_ExplorerStyleMultiSelect()
_Example_OldStyle()
_Example_ExplorerStyleSinglSelect()
_Example_ExplorerStyle_NoPlaceBar()
Func _Example_Defaults()
Local $hGui, $btn_dialog, $aFile, $sError
; Erstellt eine GUI
$hGui = GUICreate("GetOpenFileName (mit Standardeinstellungen)", 450, 296)
$iMemo = GUICtrlCreateEdit("", 2, 32, 446, 226, $WS_HSCROLL)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
$btn_dialog = GUICtrlCreateButton("Öffnen-Dialog", 180, 270, 90, 20)
GUISetState()
While 1
Switch GUIGetMsg()
Case $btn_dialog
$aFile = _WinAPI_GetOpenFileName() ; Verwendet Standards
If $aFile[0] = 0 Then
$sError = _WinAPI_CommDlgExtendedError()
MemoWrite("CommDlgExtendedError (" & @error & "): " & $sError)
Else
For $x = 1 To $aFile[0]
MemoWrite($aFile[$x])
Next
EndIf
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
GUIDelete($hGui)
EndFunc ;==>_Example_Defaults
; Gibt eine Zeile im Memo-Fenster aus
Func MemoWrite($sMessage)
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite |