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 

Simple Icon Browser

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



Joined: 02 Mar 2004
Posts: 444
Location: SLC, Utah

PostPosted: Thu Sep 29, 2005 8:29 pm    Post subject: Simple Icon Browser Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
AGU
Guest





PostPosted: Fri Sep 30, 2005 12:32 am    Post subject: Reply with quote

Nice one Mr. Green

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



Regards
AGU a.k.a AGermanUser
Back to top
beardboy



Joined: 02 Mar 2004
Posts: 444
Location: SLC, Utah

PostPosted: Fri Sep 30, 2005 1:42 am    Post subject: Reply with quote

I hadn't, I did a quick search to see if someone else had one, guess I missed it.

thanks,
beardboy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
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