Jump to content

IconSearch - another little helper by jennico


jennico
 Share

Recommended Posts

i'm still cleaning up my closet. today i found a piece of code that helped me a lot through the years to make guis nicer. i pimped it up and now will share it.

i think the name says it all. just some words:

- small and handy (3 icon display)

- clip functions

- previews

- locking icons

- extended file support: .exe, .dll, .cpl, .icl, .ocx, .ico, .cur, .ani .scr

- ordinal value and name support

as always in my scripts: no includes, no problems. :)

IconSearch.au3

[autoit]#cs

;#=#INDEX#===================================================#

;# Title .........: IconSearch.au3

;# Description ...: Searches and displays Icon Resources.

;# Date ..........: 4.1.09

;# Version .......: 1.0

;# Remarks .......: extended file support: .exe, .dll, .cpl, .icl, .ocx, .ico, .cur, .ani .scr

;# -> .scr can be used just like icons in icon controls, as GUI icons and Tray icons.

;# -> (most) .cur can be used just like icons in icon controls, as GUI icons and Tray icons.

;# -> (generally) .ani can be used in icon controls and as Tray icons (without moving though), but they will usually not show as GUI icons.

;# In AutoIt GUIs the ordinal value has to be used to define an icon.

;# For other purposes (e.g. shortcuts), the 'name' has to be used.

;# On changing between ordinal value and name, clipboard is updated (the tips not yet).

;# Search is always by ordinal value, rising from Offset, positive number first, then negative.

;# Hold 'Weiter' button to scroll forward slowly.

;# Clicking an Icon takes the following actions:

;# - File name (in quotation marks) and Icon number (seperated by comma [, ]) are put to Clipboard and can be instantly pasted to script.

;# - GUI Icon changes to selected.

;# - Tray Icon changes to selected.

;# -> Suitability of Icon can be evaluated in GUI title, explorer bar and tray (some look ugly when small).

;# - Traytip tells you current selection.

;# - Selected icon will be locked in its place and Icon number turns red.

;# -> This feature is made to enable direct comparism of icons.

:# -> A second click releases the icon.

;# -> Only left and center icon can be locked.

;# Shell32.dll cannot be deleted.

;# SciTe integration affords SciTe restart. Shortcut: AltGr+I

;# Author ........: jennico (jennicoattminusonlinedotde)

;#

Edited by jennico
Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

sorry, i will have to fix the line breaking.... one minute

okay, i made it .... have fun now.

Edited by jennico
Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

@jennico

Infortunately the creator of Iconator has kept the code source for him, so you will have to keep it up without it :o

@Valuater

You should take a look to it because it works so fine :)

Cheers, FireFox.

Edited by FireFox
Link to comment
Share on other sites

Hi and thank you for sharing.

Nice and brief and functional example jennico.

But I really don't understand how it can generate true ordinal names of the icons in a file.

(Same goes for the current emuicons.au3 example in AutoIt.)

The only time I saw the true ordinal names correctly generated was when Lazycat's emuicons v2 was used in Autoits examples. (one of the devs said it was over complicated and not needed so it was replaced with the version that's used as an example now which does not display the true ordinal names as listed in a resource).

From what I can gather you'd need to use the api calls of _ResourceEnumNames() along with the _EnumResNameProc() which will return the true ordinal names of icons as listed in a resource.

The reason I say this is ordinal names do not always go in numerical order in a resource.

eg:

Say a resource has 7 icons.

The first icon in the resource is not always 0 or 1 or the lowest number.

Also just because there's 7 icon it does not mean the ordinal names are anything from 1 to 7 or 0 to 6.

(the ordinal names may be any number for a name and they can be stored in any order).

From my experience with iconator, going by a negative index of the first icon and calculating the the true ordinal name of an icon in a resource by counting numbers based on a negative index will at some point cause false ordinal names.

Cheers

PS: @Firefox, No this is nothing like Iconator in any way at all.

Edited by smashly
Link to comment
Share on other sites

@smashly

just tested SearchIcon :) and it seems to be like Iconator but I can't extract Icons... thats the difference ?

Cheers, FireFox.

Hi,

From what I can see jenico's script is more for finding the icon index you want to use in your script.

As it's simply to view the icons in a resource and from there you can just select an icon paste the index into your own script.

I see jenico's script as more a simple to use tool with similar functionality like the emuicons.au3 example that comes with AutoIt, but the differance being able to copy and paste the index of the icon you select.

Iconator isn't for finding the index of an icon in a resource.

It's more a visual way to find what icons you want extract from a resource as an *.ico file and doesn't offer the user the index or ordinal name of the icon being extracted. (true ordinal names and or index is handled internally by iconator)

Sure iconator shows a index number when you view icons, but most the time those numbers are just ascending numbers starting from -1 to the number of icons found in the file. eg: -1, -2, -3, -4 and so on.

I could have just as easily used letters or random names or even offered the true index and or ordinal names as seen in the resource.

Also iconator can let you extract a single icon from an icon group. So you can look into a single icon and view/extract only the bit/dimensions you want in the single icon group. eg: 32bit x 48x48 or 8bit 16x16 or a combination of the bit/dimensions you want into the one icon.

Cheers

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...