rudi Posted October 8, 2010 Posted October 8, 2010 Hi. Autoit 3.3.6.1 on Windows XP SP3 (compiled and from SciTE Editor) $Sleep = 100 For $i = 1 To 238 ; shell32.dll has 238 icons (WinXP) ToolTip(" $i=" & $i, MouseGetPos(0), MouseGetPos(1)) TraySetIcon(@WindowsDir & "\system32\shell32.dll", $i) If ($i > 50) And ($i < 60) Then $Sleep = 400 ; slower, to see the # better ElseIf ($i > 130) and ($i < 160) Then $Sleep = 400 Else $Sleep = 100 EndIf Sleep($Sleep) Next This is fact for several WinXP SP3 PCs. Do I miss something? Is it a bug? Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
rudi Posted October 11, 2010 Author Posted October 11, 2010 Bump. could pls somebody tell, if he/she get's the same result? (for the values mentioned *NOT* the icon, that should be set, but the default "autoit" icon) TIA, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
jvanegmond Posted October 11, 2010 Posted October 11, 2010 You didn't describe what you're trying to do, what your code does, and what the expected results are. No wonder you're not getting a reply. Looking at your code though, I think I can guess that you're confused that shell32.dll does not have icons under certain indexes. This is not a bug, there are simply no icons there. Note, though, that every OS has a different shell32 with different icons. github.com/jvanegmond
GEOSoft Posted October 11, 2010 Posted October 11, 2010 @Rudi Try using the icon number instead of icon name as in -55 to -132. You may have to adjust those numbers by 1 0r 2, I didn't look them up. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
rudi Posted October 13, 2010 Author Posted October 13, 2010 Hi.You didn't describe what you're trying to do, what your code does, and what the expected results are. No wonder you're not getting a reply. Looking at your code though, I think I can guess that you're confused that shell32.dll does not have icons under certain indexes. This is not a bug, there are simply no icons there.Note, though, that every OS has a different shell32 with different icons.I want to select icon #55 from shell32.dll to be set as the systray icon for that script.It failed.So I did this simple script, that loops through the icons in shell32.dll, setting one after another as the "active" icon for the systray icon of the autoit script.It works fine for the most icons, but 55 and several followers in a row, the "autoit default icon" is / remains set.Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
rudi Posted October 13, 2010 Author Posted October 13, 2010 (edited) Hi. @Rudi Try using ... -55 to -132. ... Now I think I at least have an idea what these two lines mean. [cite] Passing a positive number will reference the string equivalent icon name. Passing a negative number causes 1-based "index" behaviour. Some Dll can have icon extracted just with negative numbers. [/cite] What exactly is meant by "sting equivalent icon name"? Aren't icons in DLLs always referenced with their "icon number" ? How could I read from shell32.dll, what would have been the correct "icon name"? Thanks for you helpful reply, Rudi. Edited October 13, 2010 by rudi Earth is flat, pigs can fly, and Nuclear Power is SAFE!
KaFu Posted October 13, 2010 Posted October 13, 2010 Just like GEOSoft said... HotKeySet("{ESC}","_Exit") $Sleep = 100 For $i = -1 To -238 Step -1 ; shell32.dll has 238 icons (WinXP) ToolTip(" $i=" & $i, MouseGetPos(0), MouseGetPos(1)) TraySetIcon(@WindowsDir & "\system32\shell32.dll", $i) If ($i < -50) And ($i > -60) Then $Sleep = 400 ; slower, to see the # better ElseIf ($i < -130) and ($i > -160) Then $Sleep = 400 Else $Sleep = 100 EndIf Sleep($Sleep) Next Func _Exit() Exit EndFunc OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
GEOSoft Posted October 13, 2010 Posted October 13, 2010 If you were to open that file (icon groups, not icons) in Resource Hacker instead of an icon editor you would see that there are gaps in the naming sequence(positive numbers >> string name), Shell32.dll is exactly like that. Icon editors almost always reference them by the index number which will always be a complete sequence, those that reference names require that you do some carefull checking. All you have to do is add the negative sign to let AutoIt know you are referencing an index number. When using the icons from an exe file, be careful of the first icon, it can be either 0 or -1 and that is why I said you may have to shift your number by 1 or 2. I have had more failures referencing by icon name than I care to remember. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now