AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Icon Browser - Find and use icons from any file

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
infogulch



Joined: 27 Mar 2008
Posts: 103
Location: KC, MO

PostPosted: Fri May 09, 2008 2:12 pm    Post subject: Icon Browser - Find and use icons from any file Reply with quote

Edit\ There's some better ones out there, go use them. Some refrences down below. Razz /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. Smile
_________________


Last edited by infogulch on Sat May 10, 2008 3:19 am; edited 2 times in total
Back to top
View user's profile Send private message
Guest






PostPosted: Fri May 09, 2008 6:23 pm    Post subject: Reply with quote

Interesting, but you may have re-invented the wheel.
Check out toralf's version! Wink
Back to top
infogulch



Joined: 27 Mar 2008
Posts: 103
Location: KC, MO

PostPosted: Fri May 09, 2008 6:43 pm    Post subject: Reply with quote

wow! yeah, that's better. I should've searched before I made this I guess. Laughing

yeah, i reinvented the wheel... and made it square. lol Laughing

well, mine is.. uhm.. simpler! yeah, that's it! I posted this because it's, uh, simpler than toralf's version. Right.

(for real though, go use something else Rolling Eyes)
_________________


Last edited by infogulch on Sat May 10, 2008 3:15 am; edited 1 time in total
Back to top
View user's profile Send private message
Guest






PostPosted: Fri May 09, 2008 6:56 pm    Post subject: Reply with quote

ChooseIconEx
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group