Unpredictable Posted June 9, 2011 Share Posted June 9, 2011 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 Link to comment Share on other sites More sharing options...
realshyfox Posted June 9, 2011 Share Posted June 9, 2011 (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 June 9, 2011 by realshyfox Learn, learn and ... learn Link to comment Share on other sites More sharing options...
Malkey Posted June 10, 2011 Share Posted June 10, 2011 (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 June 10, 2011 by Malkey Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now