memerim Posted March 22, 2019 Share Posted March 22, 2019 Is possible detect a selected file in desktop? I mean selected (when you only click but not open) If yes, someone could give me a example? Link to comment Share on other sites More sharing options...
Bilgus Posted March 22, 2019 Share Posted March 22, 2019 Link to comment Share on other sites More sharing options...
memerim Posted March 22, 2019 Author Share Posted March 22, 2019 (edited) @Bilgus thank you for the link, I've tested all scripts there and here: But still don't managed to make it work, what im trying is get the name or path of selected file on desktop. P.S Using win7x64 Edited March 22, 2019 by memerim Link to comment Share on other sites More sharing options...
Nine Posted March 22, 2019 Share Posted March 22, 2019 Here one way to do it : if not @AutoItX64 and @OSArch = "X64" then Exit MsgBox (0,"Error","This script only works when run in 64bits") MsgBox (0,"","Select Desktop Icons") Local $sSel = ControlListView ("[CLASS:Progman]", "", 1, "GetSelected", 1) Local $aSel = StringSplit ($sSel,"|") Local $sList = "" For $i = 1 to $aSel[0] $sList &= ControlListView ("[CLASS:Progman]", "", 1, "GetText", $aSel[$i]) & @CRLF Next MsgBox (0,$aSel[0] & " items",$sList) It is also possible to use _GUICtrlListView_* to do the same thing if you need more versatility... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
memerim Posted March 22, 2019 Author Share Posted March 22, 2019 (edited) This is what pop up when i have something selected and run the script: Edit: I compiled it as x64 then it displayed correct item selected. How can i compare the value from $sList ? If $sList = "XVI32.exe" Then ; Endif I have tried this but seens not getting the right value from $sList. Edited March 22, 2019 by memerim Link to comment Share on other sites More sharing options...
Nine Posted March 22, 2019 Share Posted March 22, 2019 $sList contains @CRLF, so use $sSel instead, it will work as long as you have only one item selected. My script allows multiple items selection. If you want to change that behavior look help file : ControlListView option parameter. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy 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