I can't speak on detecting the differences between characters in your language, but IMHO this is a better approach then using a normal auto-complete.
Try typing something like "date" into the second gui. (launched by pressing "Numpad1")
Code: Select all
#SingleInstance,Force
SetBatchLines,-1
;===============================================================================================================
;===================================== For The Demo Only =======================================================
;===============================================================================================================
PipeList:="UpdateLayeredWindow(hwnd, hdc, x="", y="", w="", h="", Alpha=255)|BitBlt(ddc, dx, dy, dw, dh, sdc, sx, sy, Raster="")|StretchBlt(ddc, dx, dy, dw, dh, sdc, sx, sy, sw, sh, Raster="")|SetStretchBltMode(hdc, iStretchMode=4)|SetImage(hwnd, hBitmap)|SetSysColorToControl(hwnd, SysColor=15)|Gdip_BitmapFromScreen(Screen=0, Raster="")|Gdip_BitmapFromHWND(hwnd)|CreateRectF(ByRef RectF, x, y, w, h)|CreateRect(ByRef Rect, x, y, w, h)|CreateSizeF(ByRef SizeF, w, h)|CreatePointF(ByRef PointF, x, y)|CreateDIBSection(w, h, hdc="", bpp=32, ByRef ppvBits=0)|PrintWindow(hwnd, hdc, Flags=0)|DestroyIcon(hIcon)|PaintDesktop(hdc)|CreateCompatibleBitmap(hdc, w, h)|CreateCompatibleDC(hdc=0)|SelectObject(hdc, hgdiobj)|DeleteObject(hObject)|GetDC(hwnd=0)|GetDCEx(hwnd, flags=0, hrgnClip=0)|ReleaseDC(hdc, hwnd=0)|DeleteDC(hdc)|Gdip_LibraryVersion()|Gdip_LibrarySubVersion()|Gdip_BitmapFromBRA(ByRef BRAFromMemIn, File, Alternate=0)|Gdip_DrawRectangle(pGraphics, pPen, x, y, w, h)|Gdip_DrawRoundedRectangle(pGraphics, pPen, x, y, w, h, r)|Gdip_DrawEllipse(pGraphics, pPen, x, y, w, h)|Gdip_DrawBezier(pGraphics, pPen, x1, y1, x2, y2, x3, y3, x4, y4)|Gdip_DrawArc(pGraphics, pPen, x, y, w, h, StartAngle, SweepAngle)|Gdip_DrawPie(pGraphics, pPen, x, y, w, h, StartAngle, SweepAngle)|Gdip_DrawLine(pGraphics, pPen, x1, y1, x2, y2)|Gdip_DrawLines(pGraphics, pPen, Points)|Gdip_FillRectangle(pGraphics, pBrush, x, y, w, h)|Gdip_FillRoundedRectangle(pGraphics, pBrush, x, y, w, h, r)|Gdip_FillPolygon(pGraphics, pBrush, Points, FillMode=0)|Gdip_FillPie(pGraphics, pBrush, x, y, w, h, StartAngle, SweepAngle)|Gdip_FillEllipse(pGraphics, pBrush, x, y, w, h)|Gdip_FillRegion(pGraphics, pBrush, Region)|Gdip_FillPath(pGraphics, pBrush, Path)|Gdip_DrawImagePointsRect(pGraphics, pBitmap, Points, sx="", sy="", sw="", sh="", Matrix=1)|Gdip_DrawImage(pGraphics, pBitmap, dx="", dy="", dw="", dh="", sx="", sy="", sw="", sh="", Matrix=1)|Gdip_SetImageAttributesColorMatrix(Matrix)|Gdip_GraphicsFromImage(pBitmap)|Gdip_GraphicsFromHDC(hdc)|Gdip_GetDC(pGraphics)|Gdip_ReleaseDC(pGraphics, hdc)|Gdip_GraphicsClear(pGraphics, ARGB=0x00ffffff)|Gdip_BlurBitmap(pBitmap, Blur)|Gdip_SaveBitmapToFile(pBitmap, sOutput, Quality=75)|Gdip_GetPixel(pBitmap, x, y)|Gdip_SetPixel(pBitmap, x, y, ARGB)|Gdip_GetImageWidth(pBitmap)|Gdip_GetImageHeight(pBitmap)|Gdip_GetImageDimensions(pBitmap, ByRef Width, ByRef Height)|Gdip_GetDimensions(pBitmap, ByRef Width, ByRef Height)|Gdip_GetImagePixelFormat(pBitmap)|Gdip_GetDpiX(pGraphics)|Gdip_GetDpiY(pGraphics)|Gdip_GetImageHorizontalResolution(pBitmap)|Gdip_GetImageVerticalResolution(pBitmap)|Gdip_BitmapSetResolution(pBitmap, dpix, dpiy)|Gdip_CreateBitmapFromFile(sFile, IconNumber=1, IconSize="")|Gdip_CreateBitmapFromHBITMAP(hBitmap, Palette=0)|Gdip_CreateHBITMAPFromBitmap(pBitmap, Background=0xffffffff)|Gdip_CreateBitmapFromHICON(hIcon)|Gdip_CreateHICONFromBitmap(pBitmap)|Gdip_CreateBitmap(Width, Height, Format=0x26200A)|Gdip_CreateBitmapFromClipboard()|Gdip_SetBitmapToClipboard(pBitmap)|Gdip_CloneBitmapArea(pBitmap, x, y, w, h, Format=0x26200A)|Gdip_CreatePen(ARGB, w)|Gdip_CreatePenFromBrush(pBrush, w)|Gdip_BrushCreateSolid(ARGB=0xff000000)|Gdip_BrushCreateHatch(ARGBfront, ARGBback, HatchStyle=0)|Gdip_CreateTextureBrush(pBitmap, WrapMode=1, x=0, y=0, w="", h="")|Gdip_CreateLineBrush(x1, y1, x2, y2, ARGB1, ARGB2, WrapMode=1)|Gdip_CreateLineBrushFromRect(x, y, w, h, ARGB1, ARGB2, LinearGradientMode=1, WrapMode=1)|Gdip_CloneBrush(pBrush)|Gdip_DeletePen(pPen)|Gdip_DeleteBrush(pBrush)|Gdip_DisposeImage(pBitmap)|Gdip_DeleteGraphics(pGraphics)|Gdip_DisposeImageAttributes(ImageAttr)|Gdip_DeleteFont(hFont)|Gdip_DeleteStringFormat(hFormat)|Gdip_DeleteFontFamily(hFamily)|Gdip_DeleteMatrix(Matrix)|Gdip_TextToGraphics(pGraphics, Text, Options, Font="", Width="", Height="", Measure=0)|Gdip_DrawString(pGraphics, sString, hFont, hFormat, pBrush, ByRef RectF)|Gdip_MeasureString(pGraphics, sString, hFont, hFormat, ByRef RectF)|Gdip_SetStringFormatAlign(hFormat, Align)|Gdip_StringFormatCreate(Format=0, Lang=0)|Gdip_FontCreate(hFamily, Size, Style=0)|Gdip_FontFamilyCreate(Font)|Gdip_CreateAffineMatrix(m11, m12, m21, m22, x, y)|Gdip_CreateMatrix()|Gdip_CreatePath(BrushMode=0)|Gdip_AddPathEllipse(Path, x, y, w, h)|Gdip_AddPathPolygon(Path, Points)|Gdip_DeletePath(Path)|Gdip_SetTextRenderingHint(pGraphics, RenderingHint)|Gdip_SetInterpolationMode(pGraphics, InterpolationMode)|Gdip_SetSmoothingMode(pGraphics, SmoothingMode)|Gdip_SetCompositingMode(pGraphics, CompositingMode=0)|Gdip_Startup()|Gdip_Shutdown(pToken)|Gdip_RotateWorldTransform(pGraphics, Angle, MatrixOrder=0)|Gdip_ScaleWorldTransform(pGraphics, x, y, MatrixOrder=0)|Gdip_TranslateWorldTransform(pGraphics, x, y, MatrixOrder=0)|Gdip_ResetWorldTransform(pGraphics)|Gdip_GetRotatedTranslation(Width, Height, Angle, ByRef xTranslation, ByRef yTranslation)|Gdip_GetRotatedDimensions(Width, Height, Angle, ByRef RWidth, ByRef RHeight)|Gdip_ImageRotateFlip(pBitmap, RotateFlipType=1)|Gdip_SetClipRect(pGraphics, x, y, w, h, CombineMode=0)|Gdip_SetClipPath(pGraphics, Path, CombineMode=0)|Gdip_ResetClip(pGraphics)|Gdip_GetClipRegion(pGraphics)|Gdip_SetClipRegion(pGraphics, Region, CombineMode=0)|Gdip_CreateRegion()|Gdip_DeleteRegion(Region)|Gdip_LockBits(pBitmap, x, y, w, h, ByRef Stride, ByRef Scan0, ByRef BitmapData, LockMode = 3, PixelFormat = 0x26200a)|Gdip_UnlockBits(pBitmap, ByRef BitmapData)|Gdip_SetLockBitPixel(ARGB, Scan0, x, y, Stride)|Gdip_GetLockBitPixel(Scan0, x, y, Stride)|Gdip_PixelateBitmap(pBitmap, ByRef pBitmapOut, BlockSize)|Gdip_ToARGB(A, R, G, B)|Gdip_FromARGB(ARGB, ByRef A, ByRef R, ByRef G, ByRef B)|Gdip_AFromARGB(ARGB)|Gdip_RFromARGB(ARGB)|Gdip_GFromARGB(ARGB)|Gdip_BFromARGB(ARGB)|StrGetB(Address, Length=-1, Encoding=0)|"
;~ ToolTip,% A_ScreenDPI / 96
Gui,1:+AlwaysOnTop -Theme +HwndGui1Hwnd
Gui,1:Color,222222,333333
Gui,1:Font,s10,Segoe UI
Gui,2:+Parent1 -Caption
Gui,2:Color,004444
Gui,2:Font,csilver s12 Bold,Segoe UI
Gui,2:Add,Text,x0 y0 w380 h40 Center 0x200,This Is The Target Window For The Demo
Gui,2:Show,x10 y10 w380 h40
Gui,1:Add,ComboBox,x50 y70 w300 r20,% PipeList
Gui,3:+Parent1 -Caption
Gui,3:Color,004444
Gui,3:Font,cYellow s10 Bold,Segoe UI
Gui,3:Add,Text,x0 y0 w380 h40 Center 0x200,***Press Numpad1 To Bring Up The Sorting Tool***
Gui,3:Show,% "x10 y" 120*(A_ScreenDPI / 96) " w380 h40"
Gui,1:Show,x200 y100 w400 h170,Demo
return
GuiClose:
GuiContextMenu:
*ESC::
ExitApp
;=====================================================================================
;=========================== Main Functionality ======================================
;=====================================================================================
;~ #IfWinActive, You know what to do here
*Numpad1::
Gui,4:New,+AlwaysOnTop -Theme
Gui,4:Color,333333,444444
Gui,4:Font,cWhite s10,Segoe UI
Gui,4:Add,Edit,x10 y10 w280 r1 vInputValue gReviseList,
Gui,4:Add,ListBox,x10 y+10 w280 r10 vComboSorter,
Gui,4:Add,Button,x+10 y10 gInjectSelection,Set Target
Gui,4:Add,Button,xp y+10 gStartOver,Start Over
gosub,GetListFromTarget
Gui,4:Show,,Sorter
return
;~ #If
4GuiClose:
Gui,4:Destroy
ComboListArray:="",ComboContentsList:="",SortedList:="",Choice:="",ComboSorter:="",InputValue:="",ComboList:=""
return
ReviseList:
GuiControlGet,InputValue
if(!InputValue){
GuiControl,4:,ComboSorter,% "|" ComboContentsList
return
}
;================================================
;================================================
SortedList:="",Count:=0,last:=""
Loop,% ComboListArray.Length()
if(InStr(ComboListArray[A_Index],InPutValue)){
SortedList.=ComboListArray[A_Index] "|"
Count++,last:=ComboListArray[A_Index]
}
;if(SortedList) ;<------- The Derp!!!
GuiControl,4:,ComboSorter,% "|" SortedList
if(Count=1){
GuiControl,4:Choose,ComboSorter,% last
goto,InjectSelection
}
;================================================
;================================================
return
GetListFromTarget:
ComboListArray:="",ComboListArray:=[],ComboContentsList:="",Index:=1
ControlGet, ComboList, List,,ComboBox1,ahk_Id %Gui1Hwnd%
Loop,Parse,ComboList,`n
if(A_LoopField)
ComboListArray[Index++]:=A_LoopField,ComboContentsList.=A_LoopField "|"
GuiControl,4:,ComboSorter,% "|" ComboContentsList
return
StartOver:
GuiControl,4:,ComboSorter,% "|" ComboContentsList
GuiControl,4:,InputValue,
return
InjectSelection:
GuiControlGet,Choice,4:,ComboSorter
Control,ChooseString,%Choice%,ComboBox1,ahk_Id %Gui1Hwnd%
Gui,4:Destroy
;================================================
;================================================
send,{Right}
;================================================
;================================================
ComboListArray:="",ComboContentsList:="",SortedList:="",Choice:="",ComboSorter:="",InputValue:="",ComboList:=""
return
;=====================================================================================
;=========================== Main Functionality End ==================================
;=====================================================================================
That is more or less just a proof of concept script and would need to be adapted to your needs and the code refined (That was written in 15-20 mins so not a lot of time was spend on refinement).
I should perhaps point out that the script above was written as a demo for using two windows, that of course doesn't have to be the case. Simple adaptations can be made to have the same functionality in one control, on one window.