Jump to content

controlsend to Exporer (Windows 7)


dost0011
 Share

Recommended Posts

Hi,

I'm angry about myself to ask this question, but I can't figure it out!!! (It's no problem with WinXP - but Win7)

I want to send a new adress to an existing Explorer. I know the handle and the title of the Exporer.

So what's the problem you ask. The Explorer changes the controlID of the explorer, depending on if I click to it or not? I can't get it work with the "Tool Window Info". However, could anybody send me the controlname of the adressfield?

It should be something like:

Controlsend($title,"",????,"c:\temp")

Please make it work :-)

Many thanks!

Link to comment
Share on other sites

Hi,

perhaps the problem was explained too abstractly.

Here's a short script that should explain the problem.

By the way: It doesn't work with WinXP also - so it's not a problem of the used windows.

I can't access the right control in the Explorer.exe.

Many thanks for help.

; Create an Explorer
ShellExecute("explorer.exe")
; German Version - change it to the title of your country
WinWait("Eigene Dateien")
$handle = WinGetHandle("Eigene Dateien","")

; c:\temp should exist in this example
Explorer_set_Adress("c:\temp",$handle)
Exit


; Actualize the adress
Func Explorer_set_Adress($Ordner,$handle)
    $title = Get_Wintitle($handle)
    if $title = "" then 
        MsgBox(0,"Error","Title could not be found!")
        Exit
    EndIf
; Here I have the problems:
; Step 1: Mark all in the adressfield
    $ret = ControlSend($title,"","Edit1","^+{END}")
    MsgBox(0,"Result",$ret)
    Exit
; Step 2: Delete the text in the adressfield
    ;ControlSend($title,"","Edit","{DEL}")
; Step 3: Send the new Folder and press "Return"        
    $text = $Ordner & @CRLF
    ;$ret = ControlSend($title,"","Edit",$text)     
EndFunc


; Changes Handle to Title
Func Get_Wintitle($handle)
    $var = WinList()
    For $i = 1 to $var[0][0]
        If $var[$i][1]=$handle Then Return $var[$i][0]
    Next
    Return ""
EndFunc
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...