Sign in to follow this  
Followers 0
Unpredictable

Text recognition

3 posts in this topic

I want to learn that is there a way i could make my auto clicker click on a specific text.For example if there are 20 text documents on my desktop but i want it to click the one that says hello i would really appreciate if someone can help me with this

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Desktop is a ListView. So you need to get a handle to it.

Get the explorer process ID, allocate memory in explorer process for LV_ITEM structure and icon name buffer after that you should allocate memory in explorer process for POINT structure and for Index.

After declaring the LVITEM structure, Point Structure and Index LVITEM structure you should copy them to the explorer process.

Then count the desktop items. Get item index, item name and item location and go for it.

I am a little busy now but if you pass here your begining I shall help you with it.

Well I should have looked deeply:

Edited by realshyfox

Learn, learn and ... learn

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Using this method, if the file on the desktop is not in the @DesktopDir or the @DesktopCommonDir directory then that file will be double clicked and needs to be visible. That is, not covered by a window.

#include <GuiListView.au3>

Local $hListView = ControlGetHandle(WinGetHandle("Program Manager", ""), "", "SysListView321")
Local $sTextToFind = "Recycle" ; <-- Enter own text here

Local $a = _GUICtrlListView_FindInText($hListView, $sTextToFind)
Local $aItem = _GUICtrlListView_GetItem($hListView, $a)

If FileExists(@DesktopDir & "\" & $aItem[3]) Then
    ShellExecute(@DesktopDir & "\" & $aItem[3])
    ;ConsoleWrite(@DesktopDir & "\" & $aItem[3] & @CRLF)
ElseIf FileExists(@DesktopCommonDir & "\" & $aItem[3]) Then
    ShellExecute(@DesktopCommonDir & "\" & $aItem[3])
    ;ConsoleWrite(@DesktopCommonDir & "\" & $aItem[3] & @CRLF)
Else
    _GUICtrlListView_ClickItem($hListView, $a, "left", False, 2)
EndIf
Edited by Malkey

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0