Jump to content
Sign in to follow this  
BlazerV60

Hiding icons/toolbar in an explorer window

Recommended Posts

BlazerV60

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

Share this post


Link to post
Share on other sites
orbs

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.

Share this post


Link to post
Share on other sites
BlazerV60

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.

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  

  • Similar Content

    • KaFu
      By KaFu
      ICU - Icon Configuration Utility

      Current Version: v6 (2018-Sep-16)
      Restore your desktop when the icons get "rearranged".
      Melba23 and I found we were working on very similar ideas to restore the Desktop icons to their normal place if they became "rearranged" (
      ). Vista seems to like this doing on occasion just for fun - but we all know some apps and games which change the display resolution or move icons around. This annoys "tidy" people who like their desktops arranged "just so" - I am particularly thinking of this desktop when I say that!
      We combined efforts and here is the result of our labors.
      Operation is easy - press "Save" to store a particular configuration and "Restore" to reset the icons to the saved positions in the selected configuration file. "Delete" allows you to remove unwanted configuration files from the list. There is a command line option so that the restoration can be run via HotKeys if required (that is why the script warns that it should be compiled for full functionality). You can decide what to do with any icons that have been added since you last saved the configuration file - the default is to put them in the top-left corner, but you can also banish them way off-screen or, more sensibly, specify a location for them.
      A new feature as of ICU v3.4 is the optional Desktop Contextmenu Integration (DCI) for Win7 (Win7 only because Microsoft implemented an easy way to do this through the registry as of this release).
      Version 3.3 should fix the empty save file bug
      Version 3.4 Win7: Admin rights no longer needed for DCI
      Version 5.0 Win8 compatibility for DCI
      The source and executable can be downloaded from my site: http://www.funk.eu
      Kudos to Ascend4nt, Melba23, Prog@ndy, & Valik for parts of the code.
      Please let me know if you found some piece of code in the source for which I forgot to mention a credit.
      Enjoy, let me know what you think of ICU and with Best Regards
    • mar3011
      By mar3011
      Hey, I have a problem I tried to look for it but it didn't solve the problem, I can't add an icon to the exe, I already know there were such topics I tried to all add exclusion C: \ Users \ Marcin \ AppData \ Local \ AutoIt v3 \ aut472.tm.exe to antivirus but after compilation, the name of the file changes, I uninstalled the anti-virus, but it didn't works, except that when I add the example icons from AutoIT it works, I downloaded icons using Firefox Developer Edition also don't works, just the downloaded graphics don't works also. Is there any solution to this problem?  
    • kneze
      By kneze
      Hi
      script read path to pst files from registry and write this informations to txt file. Unfortunately there are stored not needed lines: path  to ost file, other line has string IndexAvailableBodyand first line is blank. How can i remove anything from txt file exept path to pst files ? 
      Thanks in advance!
      #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <DateTimeConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <array.au3> #include <IE.au3> #include <WinAPIFiles.au3> #include <FileConstants.au3> #include <File.au3> #include <GUIListBox.au3> #include <Date.au3> $Form2 = GUICreate("Form1", 405, 294, 633, 264) $Button1 = GUICtrlCreateButton("Button1", 72, 48, 113, 33) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _searchPSTFiles() EndSwitch WEnd FUNC _searchPSTFiles() Global $aLines ;$sFileName = @ScriptDir & "\Pst.txt" $sFileNameTMP = @ScriptDir & "\Psttmp.txt" ;IF FileExists ($sFileName) then FileDelete ($sFileName) IF FileExists ($sFileNameTMP) then FileDelete ($sFileNameTMP) ;$logpathpst = FileOpen($sFileName, $FO_OVERWRITE) $logpathpsttmp = FileOpen($sFileNameTMP, $FO_OVERWRITE) Local $Outlookpst[30] For $i = 1 To 30 $Outlookpst[$i] = RegEnumVal("HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Search\", $i) If @error <> 0 Then ExitLoop If $Outlookpst = "" Then ContinueLoop EndIf FileWrite($logpathpstTMP, @CRLF & $Outlookpst[$i]) Next ;FileClose ($sFileName) FileClose ($sFileNameTMP) EndFunc  
    • BrewManNH
      By BrewManNH
      I was looking for a toolbar modification for SciTE and I was checking various versions of SciTE that were available on the internet. They all had some problems for how I wanted to use the editor, so I looked here to see if there were any toolbar modifications for Scite. I found one very old script by YogiBear (Volly) from 2006 that looked promising, though there were issues with it. I decided to see what I could do to modify this script, and make some improvements to it if possible. This script is the result of that work.

      It's not perfect and definitely could use some tweaking, but I thought that it had matured enough, and was mostly stable enough to release the updated version.

      Changelog:
      Version 2.0.1
      Minor update to remove all the old Obfuscator directives and replaced them with #Au3Stripper directives instead. I also corrected a minor bug that only showed up for me on one computer I tried this on, and caused the tool bar to crash for others as well.
      SciTE toolbar version 2.0
      Changed the settings values to use constants instead of 'magic numbers' The icons on the toolbar weren't lining up with the separator characters or with the toolbar GUI because they weren't set with the resize setting for the icons, only for the separators. Changed to using arrays for everything, it makes it a lot easier to loop through the controls Added a line to use an alternate path to the SciTE program, so you can start it using, for example, the portable version instead of installed version for those that don't install AutoIt and/or SciTE4AutoIt3. It will accept a commmand line parameter that points to the SciTE executable. Removed a lot of Global variables by moving the GUI creation and monitoring to the Main function and passing variables from it. I embedded the icon files into the script so that there isn't a separate download of the icon files used here. Saves download time and makes the package smaller. Modification of tools is easier because the icon names, tooltip text, and SciTE command codes are saved in the INI file upon first start up. These can be modified after the script has been run once, even after it's been compiled, by changing the ini file information, you can modify this script to automate it, or you can change it manually in any text editor. The icon files are now using, in just my opinion, better looking icons, after all it's been 7 years and icon files have matured. I have included a file with all of the constants that SciTE uses for its menu commands which comes from the SciTE source file "scite.h", so you can use this file to help you modify the commands that the toolbar works with, by figuring out what each of these values represent in SciTE. The core of the script is pretty much the same, I've just fixed a couple of issues that it had, tweaked a few things, added some new functionality and "prettied" it up a bit.

      If anyone has any suggestions as to improvements, bugs/bugfixes, etc. please let me know.

       
      scitetoolbar.zip
    • amimemeami
      By amimemeami
      I have learned how to use TraySetIcon icon and toggle between icons that I added as resources using 
      #AutoIt3Wrapper_Res_Icon_Add=C:\Program Files (x86)\AutoIt3\Icons\au3.ico My current work around is 
      Doit() Func Doit() Local $TestIcon = @ScriptDir&"\Test.ico" Local $ProdIcon = @ScriptDir&"\Prod.ico" Local $Test = "Test" Local $Prod = "Prod" Local $Current = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\My Program","Location") If $Current = $Prod Then FileCreateShortcut($Test,@DesktopCommonDir&"\TestLink.lnky",Default,Default,"Test Link",$TestIcon) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\My Program",$Test) Else FileCreateShortcut($Test,@DesktopCommonDir&"\TestLink.lnky",Default,Default,"Test Link",$ProdIcon) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\My Program",$Prod) EndIf EndFunc I did a bit of quick cutting, from my working program. Basically it creates an link on the desktop, and then deletes it and creates a new one each time it is run. If you where wondering, I made it a .lnky file so that I could add a custom right click menu for it. 
      This example came from a something I am using to switch between prod and test environments, so the actual link created does not launch the script. You can right-click on the link and run the script to change environments. The icon lets me know at a glance which environment I am currently set for. 
       
      What I am trying to figure out is if there is a way to change the icon of the executable of the script only using the resources compiled within that script. What would be nice would be to have a ScriptSetIcon function.
×