Jump to content

Pass the path from Exploer, Request


Digisoul
 Share

Recommended Posts

Hello every one,

2day is my really bad day, i m trying to find 1 function which can return the file path if user click on any file in Explorer.

I am really fed-up to see that there is no any proper Script in Whole Forum?????

Please Guys its my request; show me any proper rite path ? or tell me its possible with AutoIt or not ????

Please Its Request.

73 108 111 118 101 65 117 116 111 105 116

Link to comment
Share on other sites

  • Moderators

Hello every one,

2day is my really bad day, i m trying to find 1 function which can return the file path if user click on any file in Explorer.

I am really fed-up to see that there is no any proper Script in Whole Forum?????

Please Guys its my request; show me any proper rite path ? or tell me its possible with AutoIt or not ????

Please Its Request.

The files in the Explorer or on the Desktop are in a ListView. Using a combination of the _GUICtrlListView* functions along with some custom conversions for mouse position to client coords etc... and you could achieve it.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

The files in the Explorer or on the Desktop are in a ListView. Using a combination of the _GUICtrlListView* functions along with some custom conversions for mouse position to client coords etc... and you could achieve it.

Thanks for your Reply Guys,

Can you please Give me any example i already tried that all, some of my functions takes much CPU, if i use Sleep then, time problem; & if i use FileFind function, it give me 2 files; e.g: 123.exe, 123.jpg.

Is'nt there any other trick ?

I reay Feel HELL, when some programs do that things. :)

Edited by Digisoul

73 108 111 118 101 65 117 116 111 105 116

Link to comment
Share on other sites

I was unable to get the file extension >_<

http://www.autoitscript.com/forum/index.php?showtopic=80054

Edit: Sorry, to quick on the button there. You can always use Send("^c") and then use ClipGet() to get the full path :)

I already watched your script, there is a 1 bug i found,

The script take much CPU, if the folder hav huge criteria of files.

and 2ndly i want to use this script in loop structure, so Send("^c") will never pass the path in required time. :idiot:

73 108 111 118 101 65 117 116 111 105 116

Link to comment
Share on other sites

  • Moderators

Thanks for your Reply Guys,

Can you please Give me any example i already tried that all, some of my functions takes much CPU, if i use Sleep then, time problem; & if i use FileFind function, it give me 2 files; e.g: 123.exe, 123.jpg.

Is'nt there any other trick ?

I reay Feel HELL, when some programs do that things. :)

Yeah... that's not how it works here. You ask a question, we give you specifics to look for. You provide code you've attempted to write on your own and we give you specifics to look for and or help you with the code you've attempted.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Yeah... that's not how it works here. You ask a question, we give you specifics to look for. You provide code you've attempted to write on your own and we give you specifics to look for and or help you with the code you've attempted.

Here Is My Code , so please help me out :)

#include <WINAPI.au3>
#include <Process.au3>
#include <GUIListView.au3>
#include <Array.au3>
Global $old, $new, $dek = @DesktopDir, $docs = @MyDocumentsDir, $state = True, $found_files[1] = [""], $get = False,$founded[1]
Global $i, $handle, $chandle, $item, $path


While 1
    Sleep(80)
    If WinActive("[CLASS:CabinetWClass]") Then
        $stop = ControlGetText($handle, "", 41477)
        Switch $stop
            Case "My Computer", "Control Panel"
            Case Else
                $handle = WinGetHandle("[CLASS:CabinetWClass]")
                $chandle = ControlGetHandle($handle, "", "[CLASSNN:SysListView321]")
                getfiles()
        EndSwitch

    EndIf

WEnd
Func getfiles()
    $array_index = _GUICtrlListView_GetSelectedIndices($chandle, True)
    For $i = 0 To $array_index[0]
            $item = _GUICtrlListView_GetItemText($chandle, $array_index[$i])
            $path = ControlGetText($handle, "", 41477)
            _ReduceMemory(@AutoItPID)
            Switch $path
                Case "My Computer", "Control Panel"
                    ConsoleWrite("Invaild Paths")
                    
                Case Else
                    
                    $f_hand = FileFindFirstFile($path & "\" & $item & ".*")
                    While 1
                        Sleep(70)
                        $found = FileFindNextFile($f_hand)
                        If @error Then ExitLoop
                        If Not StringInStr(FileGetAttrib($path & "\" & $found), "D", 2) Then
                            $marking = _ArrayFindAll($founded, $path & "\" & $found)
                            If $marking = -1 Then
                                _ArrayAdd($found_files, $path & "\" & $found)
                                $get = True
                            EndIf
                        EndIf
                    WEnd
                    
                    If $get = True Then
                        getfile()
                    EndIf
            EndSwitch
;~      EndIf
        
    Next
EndFunc;==>getfiles

Func getfile()
;~  MsgBox(0, UBound($found_files), UBound($found_files) - 1)
    If UBound($found_files) - 1 <> 0 Then
        
        For $i2 = 0 To UBound($found_files) - 1
            If $found_files[$i2] <> "" Then
                ConsoleWrite("> File Is " & $found_files[$i2] & @CRLF)
                _ArrayAdd($founded, $found_files[$i2])
            EndIf
        Next
; Reset ARRAY
        $found_files = 0
        Dim $found_files[1] = [""]
        $get = False
    EndIf
EndFunc;==>getfile
Edited by Digisoul

73 108 111 118 101 65 117 116 111 105 116

Link to comment
Share on other sites

To have proper control, ideally - you would put up your own file list and capture the selections.

If you are using Vista, and hold down the shift key when you right-click a file in Explorer, the extended context pop-up menu will present the a "Copy as Path" option.

Pre-Vista, look at http://technet.microsoft.com/en-us/library/cc751394.aspx

i m trying to find 1 function which can return the file path if user click on any file in Explorer.

Link to comment
Share on other sites

To have proper control, ideally - you would put up your own file list and capture the selections.

If you are using Vista, and hold down the shift key when you right-click a file in Explorer, the extended context pop-up menu will present the a "Copy as Path" option.

Pre-Vista, look at http://technet.microsoft.com/en-us/library/cc751394.aspx

Thank you very much for your Reply DaRam, But your sugustions never full fill ma requirements. & i am using Win XP

Edited by Digisoul

73 108 111 118 101 65 117 116 111 105 116

Link to comment
Share on other sites

  • Moderators

Hello Guys No Reply At All ????????????????

You're not asking for a reply, you're asking someone to write something for you. If they chose to do so, they will do it in their own time frame. The question marks after the request is rediculous!!!!!!!

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

You're not asking for a reply, you're asking someone to write something for you. If they chose to do so, they will do it in their own time frame. The question marks after the request is rediculous!!!!!!!

Thanks for your kind Reply Sir.

73 108 111 118 101 65 117 116 111 105 116

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...