Thanks for the quick response;
I'm not sure because I have try this example
Code:
; http://www.autohotkey.com/forum/viewtopic.php?t=39120
#NoEnv
#SingleInstance Ignore
#Persistent
SendMode Input
Gui 1: Add, Button, x9 y5 w46 h23 gFindString Default, Search
Gui 1: Add, Edit, x9 y34 w100 h21 vfind,
Gui 1: Add, Edit, x9 y61 w330 h64 r3 vContent HSCROLL,
Gui 1: Add, Text, x116 y37 w200 h20 , <----- Enter 'Search String' here
Gui 1: Add, StatusBar,, Copy text to search, enter Search String and click 'Search'
SB_SetParts(300)
Gui 1: Show,, Simple Text search
WinGet ControlID, ID, Simple Text search
searchText = Initializing...
Guicontrol,,Edit2, %searchText%
Return
OnClipboardChange:
if A_EventInfo = 1
{
If searchText = Initializing...
{
sleep, 1000
searchText = Ready...`nCopy text to search here.
}
else
{
searchText = %clipboard%
}
GuiControl,,Content,%searchText%
Gui, Show
}
Return
FindString:
Gui, Submit, Nohide
if (find != lastFind) {
offset = 0
hits = 0
}
GuiControl 1:Focus, Content
SendMessage 0xB6, 0, -999, Edit2, ahk_id %ControlID%
StringGetPos pos, Content, %find% ,,offset
if (pos = -1) {
if (offset = 0) {
SB_SetText("'" . find . "' not found", 1)
SB_SetText("", 2)
}
else {
SB_SetText("No more occurrences of '" . find . "'")
SB_SetText("", 2)
offset = 0
hits = 0
}
Return
}
StringLeft __s, Content, %pos%
StringReplace __s,__s,`n,`n,UseErrorLevel
addToPos=%Errorlevel%
SendMessage 0xB1, pos + addToPos, pos + addToPos + Strlen(find), Edit2, ahk_id %ControlID%
SendMessage, EM_SCROLLCARET := 0xB7, 0, 0, Edit2, ahk_id %ControlID%
offset := pos + addToPos + Strlen(find)
lastFind = %find%
hits++
SB_SetText("'" . find . "' found in line " . addToPos + 1, 1)
SB_SetText(hits . (hits = 1 ? " hit" : " hits"), 2)
Return
GuiClose:
ExitApp
I use the select all button and the copy button of the IBM emulator (the hotkey don't exist) and the search in the copy of the clipboard works well.
Unfortunately I must do the search in the emulator windows.