Jump to content

Hiding icons/toolbar in an explorer window


Recommended Posts

Hello everyone!

I'm working on a GUI that has 2 explorer windows embedded inside of it.

Eventually I'm going to put 4 explorer windows inside of the GUI since it's convenient to have 1 program opened with 4 explorer windows embedded inside it, than having 4 seperate explorer windows opened.

Anyway, I ran into some space problems. I'm trying to remove the icons/toolbar that appears on top of the explorer windows since they take up so much space. Here's a pic of what I mean:

 

BGiNmrm.png?1

Here's my code:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <Constants.au3>

Opt("WinTitleMatchMode", 4) 

Global $hMigration, $hExplHolder, $hExplorer, $hExplorer2, $sStartDir = "C:\"
Global $iWidth = 800, $iHeight = 400

;Create the Explorer GUI
$hExplHolder = GUICreate("Explorer", $iWidth, $iHeight, Default, Default)


Run('explorer.exe /n, "' & $sStartDir & '"')
WinWait("[CLASS:CabinetWClass]") ;Wait until the window appears
WinSetState("[CLASS:CabinetWClass]","",@SW_HIDE)
WinMove($hExplorer, "", 0, 0, 400, 400)
$hExplorer = WinGetHandle("[CLASS:CabinetWClass]")


Run('explorer.exe /n, "' & $sStartDir & '"')
WinWait("[CLASS:CabinetWClass]") ;Wait until the window appears
WinSetState("[CLASS:CabinetWClass]","",@SW_HIDE)
WinMove($hExplorer2, "", 400, 0, 400, 400)
$hExplorer2 = WinGetHandle("[CLASS:CabinetWClass]")


;WinSetState($hExplorer, "", @SW_HIDE)
;WinMove($hExplorer, "", 0, 0, 400, 400)


;WinSetState($hExplorer2, "", @SW_HIDE)
;WinMove($hExplorer2, "", 400, 0, 400, 400)


_WinAPI_SetParent($hExplorer, $hExplHolder) ;Puts the explorer window inside the GUI
_WinAPI_SetWindowLong($hExplorer, $GWL_STYLE, -1064828928) ;Minuses the x button in the windows explorer (I think?)

_WinAPI_SetParent($hExplorer2, $hExplHolder) ;Puts the explorer window inside the GUI
_WinAPI_SetWindowLong($hExplorer2, $GWL_STYLE, -1064828928) ;Minuses the x button in the windows explorer (I think?)

ControlListView($hExplorer, "", "[CLASS:SysListView32; INSTANCE:1]", "ViewChange", "list")
ControlListView($hExplorer2, "", "[CLASS:SysListView32; INSTANCE:1]", "ViewChange", "list")

$hList = GUICtrlCreateListView ("File", $iWidth + 4, 4, 292, 200, 0x0003 + 0x0008 + 0x0004)
GUICtrlSetState (-1, 8)

WinSetState($hExplorer, "", @SW_SHOW)
WinSetState($hExplorer2, "", @SW_SHOW)

GUISetState(@SW_SHOW, $hExplHolder)


While 1
   $msg = GUIGetMsg()
   Switch $msg
      Case -3
         Exit
      Case -13
         GUICtrlCreateListViewItem (@GUI_DRAGFILE, $hList)
   EndSwitch
WEnd

How can I remove those top icons/toolbar so that there's more room for the file listing?

Edit: Extra props to whoever can make it so that the 2 explorer windows not do the brief flash before it disappears into the GUI.

Thanks,

Brian

Edited by BlazerV60
Link to post
Share on other sites

1) have you tried any of these?

http://winaero.com/blog/all-the-ways-to-hide-or-show-explorer-ribbon-in-windows-8/

2) how about using an alternative file manager, which is more customizable (and way, way more usable then the built-in file manager) ? there are many really good ones.

3) also, it may be more elegant to implement a file manager in AutoIt.

Link to post
Share on other sites

1) have you tried any of these?

http://winaero.com/blog/all-the-ways-to-hide-or-show-explorer-ribbon-in-windows-8/

2) how about using an alternative file manager, which is more customizable (and way, way more usable then the built-in file manager) ? there are many really good ones.

3) also, it may be more elegant to implement a file manager in AutoIt.

 

Thanks, after reading on the url you just gave me, I figure that I can try making the program perform a Ctrl+F1 press in each window, since that command will hide the ribbon.

I want to eventually make my program look like this:

5qW3K9Z.png?1

Since I have to always move files from one folder to another at work. It can get really messy when I have 4 different explorer windows opened. So I just want to deal with 1 window.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By TheAutomator
      This is Iconizer:


      This program is made to replace the free / pro version of folder maker.
      (I bundled a few icon packs with it too).

      How it works:

      Icons are copied to the selected folder, the folder icon is changed to that icon and the icon inside the folder is made hidden and read-only.
      By copying the icon to the folder itself you can now move it to another computer and the icon will stay!
      (A new icon will override the old one).

      I wrote a little installer for it to add or remove this program from/to the context menu of any folder, harddrives are also accepted:



      It runs from the contextmenu but also accepts command-line arguments if you wish.
      Just opening it without any parameters wil launch the 'Iconarchive' website.
      Let me know what you think, any tips, bugs or nice ideas are welcome 
      I'm not sure if I can upload the icons because they were extracted from the .ICL file of foldermaker..
      Kind regards! TheAutomator.
      test.bat Icon.ico Iconize.au3 Installer.au3
    • By Synaps3
      This script will make it so you can press Alt + "+" in Windows Explorer to select all files with the current file extension. This is something that I wanted for a long time and it should be a feature in Windows, but it's not. The only way to get close is to use the search thing (but then it shows the results excluding everything else) or to group by that type, but I don't want it grouped.
      You can press Alt + Enter right after to open properties on those files or you can press delete to delete only files of that type.
      You need the "Automating Windows Explorer" pack here: https://www.autoitscript.com/forum/topic/162905-automating-windows-explorer/
       
      #include "Includes\AutomatingWindowsExplorer.au3" #include <Array.au3> Opt( "MustDeclareVars", 1 ) HotKeySet("!=", "SelectTypes") Func SelectTypes() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle("[REGEXPCLASS:^(Cabinet|Explore)WClass$]") If Not $hExplorer Then MsgBox(0, "Explorer", "Could not find Windows Explorer.") Return EndIf $hExplorer = WinActive("[REGEXPCLASS:^(Cabinet|Explore)WClass$]") If Not $hExplorer Then MsgBox(0, "Explorer", "Windows Explorer is not in focus.") Return EndIf ; Get an IShellBrowser interface GetIShellBrowser($hExplorer) If Not IsObj($oIShellBrowser) Then MsgBox(0, "Explorer", "Could not get an IShellBrowser interface.") Return EndIf ; Get other interfaces GetShellInterfaces() ; Get selected files with full path ;GetFiles( $fSelected = False, $fFullPath = False, $fPidl = False, $iMax = 0 ) Local $aAllFiles = GetItems(False, False) Local $aFiles = GetItems(True, False) Local $sExt Local $i If UBound($aFiles) = 1 Then ;MsgBox(0, "Selected", $aFiles[0]) $sExt = StringRight($aFiles[0], StringLen($aFiles[0]) - StringInStr($aFiles[0], ".", 0, -1)) ;MsgBox(0, "Selected", $sExt) For $i = 0 To UBound($aAllFiles) - 1 If StringInStr($aAllFiles[$i], ".") > 0 Then If StringRight($aAllFiles[$i], StringLen($aAllFiles[$i]) - StringInStr($aAllFiles[$i], ".", 0, -1)) = $sExt Then SetSelectedItem($i) EndIf EndIf Next Else MsgBox($MB_ICONWARNING, "Error", "None or multiple items selected!") EndIf EndFunc While 1 GUIGetMsg() Wend  
    • By WoodGrain
      Hi All,
      Trying to open windows explorer to a WebDav location and it's not working quite how I want, on the computers it is setup as a "network location" (as opposed to a "mapped drive", and this unfortunately can't be changed), the "Data" WebDav folder sits directly under "This PC" if that's an easier way to get to it. any suggestions as to what I can correct to get the 2nd example to work?
      ; This works, but I'm trying to avoid this as users normally see the URL style in the 2nd example below $folderToOpen = "\\mycompany.sharepoint.com@SSL\DavWWWRoot\Data" Run("Explorer.exe " & $folderToOpen) ; This does not work, it tries to open the WebDav url in the default web browser $folderToOpen = "https://mycompany.sharepoint.com/Data" Run("Explorer.exe " & $folderToOpen) ShellExecute also opens it in the default browser.
      Saw _WinAPI_ShellOpenFolderAndSelectItems but couldn't get the 2nd example to work.
      If I manually open Windows Explorer and paste in https://mycompany.sharepoint.com/Data it loads the WebDav directory without issue.
      If I have to use the pathing from the first example it is fine, just trying to give users a familiar experience.
      Thanks!
    • By newbie2019
      Cannot find example how to locate taskbar icon coordinates or position by window handle.
      I want to use PixelChecksum to check only rectangle area over specified taskbar item.
      Please help.
      What I already have found and succesfully run for whole taskbar area:
      $taskbar = WinGetHandle("[Class:Shell_TrayWnd]") $taskbarPos = WinGetPos($taskbar) $tasklistPos = ControlGetPos($taskbar, "", "[CLASS:MSTaskListWClass; INSTANCE:1]")  $iOldCheckSum = PixelChecksum($taskbarPos[0] + $tasklistPos[0], $taskbarPos[1] + $tasklistPos[1], $taskbarPos[0] + $tasklistPos[2], $taskbarPos[1] + $tasklistPos[3]);
      I know also that I can pass window handle as parameter to PixelChecksum, but don't know how to do this with taskbar icon.
       
      Also I was able to find something similar but seems outdated: WatchWindows

      __
      thanks in advance
    • By yffulf
      Is there probably a way to click ie popup button and hide or invisible popup button in the same time?
      I try to use WinSetState @SW_hide ,
      the result is ie crashing or no response because button hide and the next click command won't work...
      $oForm=_IEFormGetObjByName($oIE,"form1") $obutton=_IEFormElementGetObjByName($oForm,"btn_OK") $hWnd = _IEPropertyGet($oIE, "hwnd") _IEAction($obutton,"focus") ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}") WinWait("", "確定存檔嗎?") WinSetState("","確定存檔嗎?",@SW_Hide) ControlClick("", "確定存檔嗎?", "[CLASS:Button; TEXT:確定; Instance:1;]")  
×
×
  • Create New...