Hiho ich hätte gerne die Funktion _GUICtrlComboBox_AutoComplete für ein Input... gibts schon sowas?
Desweiteren versteh ich dieses script auch garnet^^:
Spoiler anzeigen
#include <GUIComboBox.au3>
[/autoit] [autoit][/autoit] [autoit]Opt('MustDeclareVars', 1)
[/autoit] [autoit][/autoit] [autoit]$Debug_CB = False ; Check ClassName being passed to ComboBox/ComboBoxEx functions, set to True and use a handle to another control to see it work
[/autoit] [autoit][/autoit] [autoit]Global $hCombo
[/autoit] [autoit][/autoit] [autoit]Example_Internal()
Example_External()
Func Example_Internal()
Local $hGUI
; Create GUI
$hGUI = GUICreate("(Internal) ComboBox Auto Complete", 400, 296)
$hCombo = GUICtrlCreateCombo("", 2, 2, 396, 296)
GUISetState()
; Add files
_GUICtrlComboBox_BeginUpdate ($hCombo)
_GUICtrlComboBox_AddDir ($hCombo, @WindowsDir & "\*.exe")
_GUICtrlComboBox_EndUpdate ($hCombo)
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
[/autoit] [autoit][/autoit] [autoit]; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example_Internal
Func Example_External()
Local $hGUI
; Create GUI
$hGUI = GUICreate("(External) ComboBox Auto Complete", 400, 296)
$hCombo = _GUICtrlComboBox_Create ($hGUI, "", 2, 2, 396, 296)
GUISetState()
; Add files
_GUICtrlComboBox_BeginUpdate ($hCombo)
_GUICtrlComboBox_AddDir ($hCombo, @WindowsDir & "\*.exe")
_GUICtrlComboBox_EndUpdate ($hCombo)
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
[/autoit] [autoit][/autoit] [autoit]; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example_External
Func _Edit_Changed()
_GUICtrlComboBox_AutoComplete ($hCombo)
EndFunc ;==>_Edit_Changed
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
Local $hWndFrom, $iIDFrom, $iCode, $hWndCombo
If Not IsHWnd($hCombo) Then $hWndCombo = GUICtrlGetHandle($hCombo)
$hWndFrom = $ilParam
$iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word
$iCode = BitShift($iwParam, 16) ; Hi Word
Switch $hWndFrom
Case $hCombo, $hWndCombo
Switch $iCode
Case $CBN_CLOSEUP ; Sent when the list box of a combo box has been closed
_DebugPrint("$CBN_CLOSEUP" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $CBN_DBLCLK ; Sent when the user double-clicks a string in the list box of a combo box
_DebugPrint("$CBN_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $CBN_DROPDOWN ; Sent when the list box of a combo box is about to be made visible
_DebugPrint("$CBN_DROPDOWN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $CBN_EDITCHANGE ; Sent after the user has taken an action that may have altered the text in the edit control portion of a combo box
_DebugPrint("$CBN_EDITCHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
_Edit_Changed()
; no return value
Case $CBN_EDITUPDATE ; Sent when the edit control portion of a combo box is about to display altered text
_DebugPrint("$CBN_EDITUPDATE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $CBN_ERRSPACE ; Sent when a combo box cannot allocate enough memory to meet a specific request
_DebugPrint("$CBN_ERRSPACE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $CBN_KILLFOCUS ; Sent when a combo box loses the keyboard focus
_DebugPrint("$CBN_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $CBN_SELCHANGE ; Sent when the user changes the current selection in the list box of a combo box
_DebugPrint("$CBN_SELCHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $CBN_SELENDCANCEL ; Sent when the user selects an item, but then selects another control or closes the dialog box
_DebugPrint("$CBN_SELENDCANCEL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $CBN_SELENDOK ; Sent when the user selects a list item, or selects an item and then closes the list
_DebugPrint("$CBN_SELENDOK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
Case $CBN_SETFOCUS ; Sent when a combo box receives the keyboard focus
_DebugPrint("$CBN_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; no return value
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND
Func _DebugPrint($s_text, $line = @ScriptLineNumber)
ConsoleWrite( _
"!===========================================================" & @LF & _
"+======================================================" & @LF & _
"-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
"+======================================================" & @LF)
EndFunc ;==>_DebugPrint
Bzw. 1. was der unterschied zwischen internal und external sein soll und was die Function WM_COMMAND bewirkt ausser das sie irgendwelche daten in die console schreibt^^
Also das mit dem Input hab ich mir so vorgestellt wie das eig. auch mit der Combobox ist d.h. wenn man in die combobox explorer.exe schreiben will markiert er das was er vorschlägt auch gleich *geile sache*, nur ich bräuchte das ganze halt in einem Input und die Daten soll er aus einer Datei lesen
Es geht hierbei um eine Datenbank aus den verschiedensten Namen
Nachname Vorname1.Buchstabe
Jede Zeile beispielsweise ein Name und wenn man dann in das Input zu schreiben beginnt sollte er auch vorschläge machen die markiert sind^^
Omg hoffe ihr habt einigermaßen verstanden was ich will
THX für euren Mühen schonmal
//EDIT:
Mir ist zwar eig. der Ansatz klar,
1. muss die Datei nach dem entsprechenden, bereits eingegebenem String durchsucht werden
2. muss der erstbeste gefundene String genommen und die Länge des strings - (minus) die länge des eingegebenen strings quasi rückwärts markiert werden
nur wie coden??? gerade dann das mit dem markieren^^