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
Good evening everyone
First, I want to apologize with you for the title not very clear, but I thought a little bit on which title to set at the thread, and this is the one that came in mind.
Now, let me explain what I'm trying to understand.
I am making an application ( with n clients ), with an SQLite Database, which has a Main form, and n sub-forms...
Since these sub-forms are called several times, because they are used to add or update records to the Database, I put the code that generates the GUI of these sub-forms in Functions.
There are two sub-forms which are "treated" as two main forms, since even them have n sub-forms, which perform various tasks.
Where am I stucked?
For the Main form I created a Status Bar, in order to display messages ( add/delete/update/search results ), and it works perfectly with all the forms which don't have other sub-forms.
For the two forms, which indeed have n sub-forms, I created two separated Status Bars, which are (re)created everytime I call the function that then displays the form.
Practically, I can't set icons to these two Status Bars, and I don't know why.
I'm really sorry that I don't feel clear enough, so, here you are an example of what I am saying.
I recreated exactly what my script does:
#include <GuiButton.au3> #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Global $frmSubForm, _ $txtSubFormField, _ $sbSubFormStatusBar, _ $objSB_IconError = _WinAPI_LoadShell32Icon(109), _ $objSB_IconInformation = _WinAPI_LoadShell32Icon(277) #Region ### START Koda GUI section ### Form= $frmMainForm = GUICreate("Main Form", 300, 300, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "ExitApplication") $sbMainStatusBar = _GUICtrlStatusBar_Create($frmMainForm) $btnCreateSubForm = GUICtrlCreateButton("Create Sub Form", 105, 110, 75, 41, BitOR($BS_CENTER,$BS_VCENTER,$BS_MULTILINE)) GUICtrlSetOnEvent(-1, "GenerateSubForm") GUICtrlSetFont(-1, 10, 400, 0, "Arial") _GUICtrlStatusBar_SetSimple($sbMainStatusBar) _GUICtrlStatusBar_SetText($sbMainStatusBar, "") GUISetState(@SW_SHOW, $frmMainForm) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func ExitApplication() Exit EndFunc Func GenerateSubForm() #Region ### START Koda GUI section ### Form= $frmSubForm = GUICreate("Sub-Form", 300, 300, -1, -1, -1, -1, $frmMainForm) GUISetOnEvent($GUI_EVENT_CLOSE, "DeleteSubForm") $txtSubFormField = GUICtrlCreateInput("", 0, 0, 100, 20) $btnCheckSubFormField = GUICtrlCreateButton("Check Field", 105, 110, 75, 41, BitOR($BS_CENTER,$BS_VCENTER,$BS_MULTILINE)) GUICtrlSetOnEvent(-1, "CheckSubFormField") GUICtrlSetFont(-1, 10, 400, 0, "Arial") $sbSubFormStatusBar = _GUICtrlStatusBar_Create($frmSubForm) _GUICtrlStatusBar_SetSimple($sbSubFormStatusBar) _GUICtrlStatusBar_SetText($sbSubFormStatusBar, "") GUISetState(@SW_SHOW, $frmSubForm) GUISetState(@SW_DISABLE, $frmMainForm) #EndRegion ### END Koda GUI section ### EndFunc Func DeleteSubForm() ; Declared Globally => $frmSubForm GUIDelete($frmSubForm) GUISetState(@SW_ENABLE, $frmMainForm) EndFunc Func WriteToStatusBar($sbStatusBar, $objSB_Icon, $strText) _GUICtrlStatusBar_SetIcon($sbStatusBar, 0, $objSB_Icon) _GUICtrlStatusBar_SetText($sbStatusBar, $strText) ConsoleWrite("Icon Handle: " & $objSB_Icon & @CRLF) EndFunc Func CheckSubFormField() ; Declared Globally => $txtSubFormField If GUICtrlRead($txtSubFormField) = "" Then ; Declared Globally => $sbStatusBar WriteToStatusBar($sbSubFormStatusBar, $objSB_IconError, "Field NOK.") Else WriteToStatusBar($sbSubFormStatusBar, $objSB_IconInformation, "Field OK.") EndIf EndFunc The text is set, but icon is not.
Could someone please tell me why?
Thanks everyone in advance
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?
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.