Search files or folder by add file name and target. DisPlay files use ToolTip
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Files Serach", 218, 170, -1, -1)
$Label1 = GUICtrlCreateLabel("File name:", 64, 8, 52, 17)
$Input1 = GUICtrlCreateInput("", 16, 32, 185, 21)
$Button1 = GUICtrlCreateButton("Fine in", 120, 136, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Serach", 16, 136, 75, 25, $WS_GROUP)
$Input2 = GUICtrlCreateInput("", 16, 96, 185, 21)
$Label2 = GUICtrlCreateLabel("Target:", 72, 72, 38, 17)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$fSource = FileSelectFolder("Choose a drive or folder", @DesktopCommonDir, 2)
If Not $fSource Then
$filefound = (GUICtrlRead($Input2)&'\*')
Else
GUICtrlSetData($Input2, $fSource)
EndIf
Case $Button2
$filefound = (GUICtrlRead($Input2)&'\*')
$search = FileFindFirstFile($filefound)
If $search = -1 Then Exit
Do
$files = FileFindNextFile($search)
ToolTip($files, 400, 345, "Searching...Please wait!")
Sleep(1)
If $files = GUICtrlRead($Input1) Then
ToolTip("")
ExitLoop
EndIf
Until $files = ''
If $files Then
MsgBox(64, "", "File found = "& $files)
$btn = MsgBox(36, "", "Do you wanted found Target?")
If $btn = 7 Then Exit
ShellExecute(GUICtrlRead($Input2))
Else
MsgBox(64, "", "File not found.")
EndIf
EndSwitch
WEnd