Sign in to follow this  
Followers 0
JohnBailey

Get the address of an Explorer Window

15 posts in this topic

I've been searching and cannot find (or overlooked via wrong keywords) something I thought would be simple and in the help file.

Where do I research how to get the address of a particular Explorer window? For instance, Program Files is open and I want to retrieve the address which is C:\Program Files\ and is in the "Address" input of that window.

Thanks for the nudges


A decision is a powerful thing

Share this post


Link to post
Share on other sites



ControlGetText()


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

ControlGetText()

HAHA! I'm a dork yeah that would totally do the trick!

:Here's to missing the easy ways:

thanks! :)


A decision is a powerful thing

Share this post


Link to post
Share on other sites

You're welcome.

Opt("WinTitleMatchMode", 4)
$hwndExplorer = WinGetHandle("[CLASS:ExploreWClass; INSTANCE:1]","")
ConsoleWrite(ControlGetText($hwndExplorer,"","[CLASS:Edit; INSTANCE:1]") & @LF)

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

You're welcome.

That's way better than what I was doing!

Opt("WinTitleMatchMode",4)
$WinList=WinList("classname=CabinetWClass")
;$WinList=WinList("classname=ExploreWClass")
;_ArrayDisplay($winlist)
For $c=1 to $WinList[0][0]
    MsgBox(0, WinGetTitle($WinList[$c][0]), ControlGetText(WinGetTitle($WinList[$c][0]),'','Edit1'))
Next

A decision is a powerful thing

Share this post


Link to post
Share on other sites

Blue_Drache, you wouldn't happen to know how to determine if the folderlist that shows up on the left is open or closed and then cause it to open or close?

I'm looking into winmgmts and creating a obj of that, but I don't think that's going to answer this. I tried to retrieving info on the folderlist, but could not get exact details on it.


A decision is a powerful thing

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

If you wanted to get all of them using the WinList() method, then this would be what I use.

Opt("WinTitleMatchMode", 4)
$a_List = WinList("[CLASS:ExploreWClass]")
For $intLoop = 1 To $a_List[0][0]
    ConsoleWrite($intLoop & " " & ControlGetText($a_List[$intLoop][1], "", "[CLASS:Edit; INSTANCE:1]") & @LF)
Next

Regarding your next question, I don't know. I guess you could check for the existance of the "[CLASS:SysTreeView32]" Control in the current window.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Blue_Drache

Where you see this class? ExploreWClass

I get IEFrame from the Explorer window...

And BTW, you not have to use Opt("WinTitleMatchMode", 4) with the extended methods..

$hwndExplorer = WinGetHandle("[CLASS:ExploreWClass; INSTANCE:1]","")
ConsoleWrite(ControlGetText($hwndExplorer,"","[CLASS:Edit; INSTANCE:1]") & @LF)

It's work without it as well :)

Edited by MsCreatoR

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Blue_Drache

Where you see this class? ExploreWClass

I get IEFrame from the Explorer window...

And BTW, you not have to use Opt("WinTitleMatchMode", 4) with the extended methods..

I prefer to set the advanced options, in the event I get lazy.

>>>> Window <<<<
Title:  My Computer
Class:  ExploreWClass
Position:   577, 51
Size:   800, 600
Style:  0x16CF0000
ExStyle:    0x00000100

>>>> Control <<<<
Class:  Edit
Instance:   1
ClassnameNN:    Edit1
ID: 41477
Text:   
Position:   72, 63
Size:   594, 14
ControlClick Coords:    178, 2
Style:  0x54000080
ExStyle:    0x00000000

>>>> Mouse <<<<
Position:   831, 139
Cursor ID:  2
Color:  0x000000

>>>> StatusBar <<<<
1:  
2:  
3:  My Computer

>>>> Visible Text <<<<
Links
My Computer
My Computer
FolderView


>>>> Hidden Text <<<<

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

What would be awesome is if we could just create an obj and control it similar to the _IE.au3 that Dale did.


A decision is a powerful thing

Share this post


Link to post
Share on other sites

What's to stop you from creating an _Explorer.au3 ? Pure and unadulterated laziness and no pressing need are my excuses. From what I understand, Explorer is merely an extension of IE, or vice versa... Either way, they're interchangable, so the same COM calls can work in one as in the other once you got ahold of the object handle.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

What's to stop you from creating an _Explorer.au3 ? Pure and unadulterated laziness and no pressing need are my excuses. From what I understand, Explorer is merely an extension of IE, or vice versa... Either way, they're interchangable, so the same COM calls can work in one as in the other once you got ahold of the object handle.

I HAD NO IDEA!

and yeah I want to create an _Explorer.au3


A decision is a powerful thing

Share this post


Link to post
Share on other sites

What's to stop you from creating an _Explorer.au3 ? Pure and unadulterated laziness and no pressing need are my excuses. From what I understand, Explorer is merely an extension of IE, or vice versa... Either way, they're interchangable, so the same COM calls can work in one as in the other once you got ahold of the object handle.

One thing though, IE and Explorer are actually two different exe's. Does that matter?


A decision is a powerful thing

Share this post


Link to post
Share on other sites

It appears I'm talking about Explorer Shell


A decision is a powerful thing

Share this post


Link to post
Share on other sites

Blue_Darche

#412962


A decision is a powerful thing

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