ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

AutoHotkey: LiveSearch example

(1/1)

justice:
Might be useful for N.A.N.Y. this year I thought for those who will use AHK like me. Find below an example of live processing of the contents of an editbox. You can use it to filter a listview for example.

expand code; Live Search Example
; Performance enchancements
#NoEnv
SetBatchLines, -1
SetKeyDelay, 0

Gui, Add, Edit, vMyEdit gLiveSearch, %LastMyEdit%
Gui, Show

LiveSearch:
   Gui, Submit, NoHide ; or without submitting use get ControlGetText, MyEdit, Edit1, %MainWnd%
   ifEqual, LastMyEdit,MyEdit ; don't process no changes
      return
   Gosub,LiveSearchProcess
return

LiveSearchProcess:
   Tooltip % MyEdit
   LastMyEdit := MyEdit
return


Navigation

[0] Message Index

Go to full version