Sign in to follow this  
Followers 0
JohnBailey

Get Folderview Panel Status of an Explorer Window

2 posts in this topic

#1 ·  Posted (edited)

How do I retrieve whether or not an explorer window has the folderview panel open or closed. There is an example below taken from the help file, but adjusted to show things can be set and things can be retrieved. All mentions of this online referencing msdn's site or a direct search on msdn, turns up dead links on msdn. I thought by now I'd stumble on the answer.

; Example 1
;
; Counting the number of open shell windows

$oShell = ObjCreate("shell.application"); Get the Windows Shell Object
$oShellWindows=$oShell.windows; Get the collection of open shell Windows

if Isobj($oShellWindows) then

  $string=""        ; String for displaying purposes

  for $Window in $oShellWindows; Count all existing shell windows
    $String = $String & $window.LocationName & @CRLF
;$window.Visible=0
    ConsoleWrite('Shell Msg: '& $window.locationURL () &@LF)
  next

;Msgbox(0,"Shell Windows","You have the following shell windows:" & @CRLF & @CRLF & $String);

endif

NOTE: the folderview panel I'm referring to may just be referred to by smarter people as just Folder Panel or Folder Toolbar

GETTING CLOSE

Thank you Dale for getting me the function name

http://msdn2.microsoft.com/en-us/library/bb774150.aspx

This shows how to open it, but how do we find out / get if it's already open

TOOLS FOR THOSE HELPING

http://msdn2.microsoft.com/en-us/library/bb762759.aspx

http://msdn2.microsoft.com/en-us/library/bb774150.aspx

"Non-msdn-method": #422514

Edited by JohnBailey

A decision is a powerful thing

Share this post


Link to post
Share on other sites



While this is not an "msdn method" (as I'm looking for), this is a bit closer in effect.

The problem with the below , even, is that it returns only if the folders bar was ever open in that window. That is not the same a currently open.

$oShell = ObjCreate("shell.application")   ; Get the Windows Shell Object
If Not IsObj($oShell) Then
    MsgBox(0,'','Not Obj')
    Exit
EndIf
$oShellWindows=$oShell.windows
$wincountTotal=$oShell.windows.count
For $Window in $oShellWindows       ; Count all existing shell windows
    ConsoleWrite('Shell Msg: '& $window.locationURL () &@LF)
; Gets
    Local $thisHwd = HWnd($window.HWnd())
    Local $BrowserBar_HWnd=ControlGetHandle($thisHwd,'','[Class:SysTreeView32;Instance:1]');'[Class:ReBarWindow32;Instance:2]')
    Local $BrowserBar_PosA = ControlGetPos($thisHwd,'',$BrowserBar_HWnd)
;Actions
;WinActivate($thisHwd)

;Control Returns
    ConsoleWrite('Control: '&$BrowserBar_HWnd&@LF)
    ConsoleWrite('Control Pos X: '&$BrowserBar_PosA[0]&@LF)
    ConsoleWrite('Control Pos Y: '&$BrowserBar_PosA[1]&@LF)
Next

Anyone want to help? ::Nudge::


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