Lazycat Posted August 2, 2007 Share Posted August 2, 2007 (edited) First version of script I'm done for including in Autoit package as example. Since this time script was not changed, except someone added ability (incorrect) to view icon names.Here a bit redone version with some advantages:-correct names retreiveing (thanks piccaso for a great callback UDF)-correct finding number of icons-ability to copy name/index to clipboard-fixed drag'n'drop handler-some GUI tweaksHistory:2.0 - Initial release2.1 - Fixed bug with CPU hog as result (thanks smashly)enumicons_v2.zip2.2 - Fixed to latest DllCall syntax changes (only for 3.2.9.5 an up)2.2a - Yet another fix for latest beta, since it now support pointer typeenumicons_v2.2a.zip2.3 - Nothing new, just changed code to use native callback functionalityenumicons_v2.3.zip Edited December 18, 2007 by Lazycat Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
James Posted August 2, 2007 Share Posted August 2, 2007 That's better. It should be replaced with the current version. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Gif Posted August 2, 2007 Share Posted August 2, 2007 thats great!! but is there a possibility to make it save the icons? that would be perfect, i saw a program on nirsoft.net called iconextractor and it saves the icons Link to comment Share on other sites More sharing options...
gseller Posted August 2, 2007 Share Posted August 2, 2007 Nice improvements... Link to comment Share on other sites More sharing options...
Zedna Posted August 2, 2007 Share Posted August 2, 2007 Lazycat great stuff!! I learned something new, especially DllCallBack using. Thanks for sharing. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
smashly Posted October 8, 2007 Share Posted October 8, 2007 Thank You Lazycat for your excellent educational example, as it really filled in some blanks for me using the callback function But I really think 1 small change is required to make your efforts more CPU friendly when pointing at an icon. As is the CPU usage sky rockets to 100% while pointing at an icon. Suggested change for your most excellent educational example: While 1 $aInfo = GUIGetCursorInfo() If IsArray($aInfo) Then If ($aInfo[4] >= $ahIcons[0] And $aInfo[4] <= $ahLabels[29]) Then ;If $hSelected = $aInfo[4] Then ContinueLoop ; Original line... If $hSelected <> $aInfo[4] Then ;;<-- Changed above line for less CPU usage $pos = ControlGetPos($hGui, "", $aInfo[4]) If $pos[2] = 58 Then ; Label GUICtrlSetPos($hOverlay, $pos[0] - 1, $pos[1] + $pos[3] - 60) Else ; Icon GUICtrlSetPos($hOverlay, $pos[0] - 14, $pos[1] - 5) EndIf $hSelected = $aInfo[4] EndIf ;<-- Added to close the edited If statement above EndIf EndIf Sorry to drag up an old post, but I only noticed this today when using your example from the examples folder in AutoIt 3.2.8.1 Cheers Link to comment Share on other sites More sharing options...
Lazycat Posted October 8, 2007 Author Share Posted October 8, 2007 Thank You Lazycat for your excellent educational example, as it really filled in some blanks for me using the callback functionBut I really think 1 small change is required to make your efforts more CPU friendly when pointing at an icon.As is the CPU usage sky rockets to 100% while pointing at an icon.Suggested change for your most excellent educational example: CheersThanks, it's really eating a lot of CPU I'm not noticed this before.Fixed as you suggested, and updated callback UDF to latest 6.5 version. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
nobbe Posted October 10, 2007 Share Posted October 10, 2007 hi nice work i am using holgers "modernmenu" menu library to be compatible with the ordinal indexes used there i changed If $bOrdinal then GUICtrlSetImage($ahIcons[$iCurIndex], $glFileName, -($iStartIndex + $iCurIndex)) ; GUICtrlSetData($ahLabels[$iCurIndex], -($iStartIndex + $iCurIndex) ) GUICtrlSetData($ahLabels[$iCurIndex], ($iStartIndex + $iCurIndex) -1 ) ;;; for modern menu Else now the icon index starts with "0" and has positive numbers Link to comment Share on other sites More sharing options...
GEOSoft Posted October 23, 2007 Share Posted October 23, 2007 (edited) @LazyCat I just played with this for a thread in Help and support and noticed that it seems to be returning a lot of wrong values for the context menu selections. Just a heads up. EDIT: Forget this. It must have been an older version. I just tried the latest and it was fine. Suggestion; Maybe add 1 more Context item? Filename & Ordinal value The clipboard would contain <filepath & name>, ordinal. That way if some one was setting an icon they could select that and get something like C:\Windows\System32\Shell32.dll, -1 to be pasted into GUISetIcon(Paste here) Edited October 23, 2007 by GEOSoft 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!" Link to comment Share on other sites More sharing options...
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