infogulch
Joined: 27 Mar 2008 Posts: 103 Location: KC, MO
|
Posted: Fri May 09, 2008 2:12 pm Post subject: Icon Browser - Find and use icons from any file |
|
|
Edit\ There's some better ones out there, go use them. Some refrences down below. /E
I made this because I wanted to use some icons from dlls in my windows directory, and wanted an easier way to find and use them. This script shows 10 icons and their corresponding icon numbers, lets you see to the next 10, previous 10 and browse for a different file to look in.
Here's the code:
| Code: |
;These are just default settings
StartAt := 150
IconPath = %A_WinDir%\System32\Shell32.dll
GoSub IndexSet
GoSub CreateGui
GoSub Control ;I guess I'm not creating the gui right, cause it gives garbage until it goes through the Control label, but it works ok after that. :)
Menu, Tray, NoStandard
Menu, Tray, Add, Hide
Menu, Tray, Add, Show
Menu, Tray, Add, Exit
Gui, Show,, Icon Finder
return
IndexSet:
Index1 := StartAt
Index2 := StartAt +1
Index3 := StartAt +2
Index4 := StartAt +3
Index5 := StartAt +4
Index6 := StartAt +5
Index7 := StartAt +6
Index8 := StartAt +7
Index9 := StartAt +8
Index10 := StartAt +9
Return
CreateGui:
Gui, +LastFound
Gui, Add, Text, y0 x7 w37, %Index1%:
Gui, Add, Text, y0 x57 w37, %Index2%:
Gui, Add, Text, y0 x107 w37, %Index3%:
Gui, Add, Text, y0 x157 w37, %Index4%:
Gui, Add, Text, y0 x207 w37, %Index5%:
Gui, Add, Pic , y20 x7 w32 h32 icon%Index1%, %IconPath%
Gui, Add, Pic , y20 x57 w32 h32 icon%Index2%, %IconPath%
Gui, Add, Pic , y20 x107 w32 h32 icon%Index3%, %IconPath%
Gui, Add, Pic , y20 x157 w32 h32 icon%Index4%, %IconPath%
Gui, Add, Pic , y20 x207 w32 h32 icon%Index5%, %IconPath%
Gui, Add, Text, y80 x7 w37, %Index6%:
Gui, Add, Text, y80 x57 w37, %Index7%:
Gui, Add, Text, y80 x107 w37, %Index8%:
Gui, Add, Text, y80 x157 w37, %Index9%:
Gui, Add, Text, y80 x207 w37, %Index10%:
Gui, Add, Pic , y100 x7 w32 h32 icon%Index6%, %IconPath%
Gui, Add, Pic , y100 x57 w32 h32 icon%Index7%, %IconPath%
Gui, Add, Pic , y100 x107 w32 h32 icon%Index8%, %IconPath%
Gui, Add, Pic , y100 x157 w32 h32 icon%Index9%, %IconPath%
Gui, Add, Pic , y100 x207 w32 h32 icon%Index10%, %IconPath%
Gui, Add, Button, y160 x7 gLast, <-
Gui, Add, Button, y160 x37 gNext, ->
Gui, Add, Edit, y160 x70 w40 vStartAt
Gui, Add, Edit, y190 x7 w200 vIconPath
Gui, Add, Button, y190 x220 gBrowse, . . .
Return
Control:
GuiControl,, Static1, %Index1%:
GuiControl,, Static2, %Index2%:
GuiControl,, Static3, %Index3%:
GuiControl,, Static4, %Index4%:
GuiControl,, Static5, %Index5%:
GuiControl,, Static6, *icon%Index1% %IconPath%
GuiControl,, Static7, *icon%Index2% %IconPath%
GuiControl,, Static8, *icon%Index3% %IconPath%
GuiControl,, Static9, *icon%Index4% %IconPath%
GuiControl,, Static10, *icon%Index5% %IconPath%
GuiControl,, Static11, %Index6%:
GuiControl,, Static12, %Index7%:
GuiControl,, Static13, %Index8%:
GuiControl,, Static14, %Index9%:
GuiControl,, Static15, %Index10%:
GuiControl,, Static16, *icon%Index6% %IconPath%
GuiControl,, Static17, *icon%Index7% %IconPath%
GuiControl,, Static18, *icon%Index8% %IconPath%
GuiControl,, Static19, *icon%Index9% %IconPath%
GuiControl,, Static20, *icon%Index10% %IconPath%
GuiControl,, StartAt, %StartAt%
GuiControl,, IconPath, %Iconpath%
return
Browse:
FileSelectFile, FilePath
If !FilePath
Return
GuiControl, , IconPath, %FilePath%
Gui, Submit, NoHide
StartAt = 1
Gosub, IndexSet
Goto, Control
Return
Next:
sStartAt := StartAt
Gui, Submit, NoHide
If StartAt is not digit
StartAt = 1
if (StartAt != sStartAt)
{
GoSub IndexSet
GoTo Control
}
Loop, 10
Index%A_Index% += 10
If Index1 is not digit
{
StartAt = 1
Gosub, IndexSet
}
GoTo Control
return
Last:
sStartAt := StartAt
sIconPath := IconPath
Gui, Submit, NoHide
If StartAt is not digit
StartAt = 1
if (StartAt != sStartAt OR IconPath != sIconPath)
{
GoSub IndexSet
GoTo Control
}
Loop, 10
Index%A_Index% -= 10
If Index1 is not digit
{
StartAt = 1
Gosub, IndexSet
}
GoTo Control
return
Hide:
Gui, Hide
return
Show:
Gui, Show
return
Exit:
ExitApp
return | Thanks for looking.  _________________

Last edited by infogulch on Sat May 10, 2008 3:19 am; edited 2 times in total |
|