Hello Phoenix XL,
Thanks for this excellent script! I am very new to this. I am trying to see if I can use it but one thing I am not able to figure out how to accomplish. This is what I have so far, all taken from your examples:
#cs
Predict Text - Phoenix XL
This code is taken from AutoIt @ http://www.autoitscript.com/forum/topic/143380-predict-text-for-an-edit-control-predicttextau3-udf/
#ce
#include-once
#include <GUIConstants.au3>
#include 'PredictText.au3'
;Our Graphic User Interface
$hGUI = GUICreate('Predict Text - Phoenix XL', 500, 400)
GUICtrlCreateGroup("Edit Group - Number Check", 5, 10, 490, 170)
GUICtrlCreateLabel("Type any number to Find Out What Happens", 10, 30, 480, 30)
Global $Edit1 = GUICtrlCreateEdit('', 10, 50, 480, 120)
GUICtrlCreateGroup("", -99, -99, 480, 30)
GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND')
GUISetState()
;GUI Message Loop
Local $iGUIGetMsg
While 1
$iGUIGetMsg = GUIGetMsg()
Switch $iGUIGetMsg
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
;$lParam is the Handle of the Control.
;When Focus is set to an Edit Control Change the Prediction of the Edit Controls.
If _WinAPI_HiWord($wParam) = $EN_SETFOCUS Then
;The Words which have to be Predicted for First Edit Box.
Local $_Words1[22] = ['345','3456','456','4567','567','5678','6789012345678','678','789012345678','754','8765','87654','90123','901','123','1234','12345','123456','2345','234','23','234567']
;The Words which have to be Predicted for Second Edit Box.
If $lParam = GUICtrlGetHandle($Edit1) Then
;Case-Sensitive
_RegisterPrediction($lParam, $_Words1, 1, 0, 0, 1)
EndIf
EndIf
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND
When you run the above code and then type the number 1, you are presented with 123, 1234, 12345, and 123456 in the Predict window, with 123 already filled in the Edit control (the 23 part is highlighted) . What I need is for nothing to get prefilled in the Edit widow except what I just typed,1, and instead wait till I make the selection of which number from the Predict window needs to be filled in the Edit control.
Is that possible? Any help is greatly appreciated.
Thanks.