beardboy
Joined: 02 Mar 2004 Posts: 444 Location: SLC, Utah
|
Posted: Thu Sep 29, 2005 8:29 pm Post subject: Simple Icon Browser |
|
|
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.
| 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 |
|