DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: AutoHotkey: LiveSearch example  (Read 6,850 times)

justice

  • Solve issues simply.
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • Participated in NANY Challenge Four Times
    • Cody Award
    • Coding Snacks
    • DJ Badge - DJ
AutoHotkey: LiveSearch example
« on: November 26, 2008, 11:32 AM »
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
2008-11-26_113103.png
« Last Edit: November 26, 2008, 11:59 AM by justice »

Original address: https://www.donationcoder.com/forum/index.php?topic=15888.0