Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Simple Icon Browser


  • Please log in to reply
2 replies to this topic
beardboy
  • Members
  • 443 posts
  • Last active: May 27 2017 08:41 AM
  • Joined: 02 Mar 2004
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.

Posted Image

; 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

AGU
  • Guests
  • Last active:
  • Joined: --
Nice one :mrgreen:

btw. reminds me off toralfs Iconviewer light. Have you seen this one?
http://www.autohotke...opic.php?t=4301

Posted Image

Regards
AGU a.k.a AGermanUser

beardboy
  • Members
  • 443 posts
  • Last active: May 27 2017 08:41 AM
  • Joined: 02 Mar 2004
I hadn't, I did a quick search to see if someone else had one, guess I missed it.

thanks,
beardboy