AutoHotkey Community

It is currently May 27th, 2012, 12:44 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Simple Icon Browser
PostPosted: September 29th, 2005, 8:29 pm 
Offline

Joined: March 2nd, 2004, 10:10 pm
Posts: 443
Location: SLC, Utah
Here is a simple Icon Browser script that users can use to help add icons to their scripts. If you hover your mouse over the icons it will show you some code on how to add it to your script, and if you click on an icon it will copy that code to the clipboard.

Image

Code:
; Program: Icon Browser
; Version: 00
; Last Modified: 2005.09.29
; Last Changes: First Version

file = %SystemRoot%\system32\SHELL32.dll

Start:
Gui, Destroy
SetBatchLines, -1
Gui, Margin, 5, 5
Gui, color, white
Gui, font, s8, Tahoma
Gui, Add, Edit, w300 r1 readonly vFile -Multi, %file%
Gui, Add, Button, x+5 h20 gSelectFile, ...
Loop, 500
{
  if a_index = 1
    Gui, add, Pic, xm y+5 w32 h32 icon%a_index% border altsubmit gIcon vIcon%a_index%, %file%
  else if a_index in 1,21,41,61,81,101,121,141,161,181,201,221,241,261,281,301
    Gui, add, Pic, xm y+2 w32 h32 icon%a_index% border altsubmit gIcon vIcon%a_index%, %file%
  else
    Gui, add, Pic, x+2 w32 h32 icon%a_index% border altsubmit gIcon vIcon%a_index%, %file%
  GuiControlGet, test, pos, Icon%a_index%
  if testw <> 34
  {
    GuiControl, Hide, Icon%a_index%
    break
  }
}
Gui, Show,, Icon Browser
OnMessage(0x200, "WM_MOUSEMOVE")
return

WM_MOUSEMOVE(wParam, lParam)
{
  Global file,outputvarcontrol,disabletool
  if disabletool = 1
    return
  MouseGetPos,,,, OutputVarControl
  StringTrimLeft, icon, outputvarcontrol, 6
  CurrentTip = IconFileName = %file%`nIL_Add(ImageListID1, IconFileName, %icon%)`nGui,add, pic, Icon%icon%, %file%
  If (tt_TipShown <> CurrentTip)
  {
    IfNotInString, outputvarcontrol, Static
      ToolTip
    else
      ToolTip, %currenttip%
  }
}

GuiClose:
ExitApp

SelectFile:
FileSelectFile, File, 1, %systemroot%\system32\, Select Icon File, Icon Files (*.ico; *.dll; *.exe)
GuiControl,, File, %file%
Goto, Start
return

Icon:
Gui, +OwnDialog
StringTrimLeft, icon, a_guicontrol, 4
clipboard = IconFileName = %file%`nIL_Add(ImageListID1, IconFileName, %icon%)`nGui,add, pic, Icon%icon%, %file%
disabletool = 1
ToolTip
MsgBox, Text Copied to Clipboard.
disabletool = 0
return

thanks,
beardboy


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 30th, 2005, 12:32 am 
Nice one :mrgreen:

btw. reminds me off toralfs Iconviewer light. Have you seen this one?
http://www.autohotkey.com/forum/viewtopic.php?t=4301

Image

Regards
AGU a.k.a AGermanUser


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 30th, 2005, 1:42 am 
Offline

Joined: March 2nd, 2004, 10:10 pm
Posts: 443
Location: SLC, Utah
I hadn't, I did a quick search to see if someone else had one, guess I missed it.

thanks,
beardboy


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bon, Google Feedfetcher, hughman, maul.esel, Yahoo [Bot] and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group