AutoHotkey Community

It is currently May 27th, 2012, 1:44 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Picture Launcher
PostPosted: January 16th, 2010, 12:40 am 
Offline

Joined: October 28th, 2006, 5:01 pm
Posts: 58
I wanted an application launcher that could work with any picture so I made this one. Middle mouse button launches the gui. Tooltips show what will be launched if you left click there. 8-ball will hide gui. Enjoy!

Screenshot: Image

Save this graphic to wherever you put the script:http://www.autohotkey.net/~netfun81/pool%20balls.png

Code:
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

Gui +ToolWindow -Caption +AlwaysOnTop
Gui, Color, EEAA99
Gui +LastFound
WinSet, TransColor, EEAA99
pic:="pool balls.png"
Gui  Add, Picture, x5 y5, %pic%
Gui, show, hide w333 h160
return

loop:
MouseGetPos, x, y
getKeyState, state, LButton
if state = D
gosub launch
else
gosub tooltip
return

tooltip:
if (x > 140 and x < 190) and (y > 90 and y < 140)
ToolTip, Explorer
if (x > 100 and x < 150) and (y > 70 and y < 120)
tooltip, firefox
if (x > 180 and x < 230) and (y > 70 and y < 120)
tooltip, IE
if (x > 70 and x < 120) and (y > 50 and y < 80)
tooltip, chrome
if (x > 140 and x < 190) and (y > 50 and y < 80)
tooltip, hide gui
if (x > 210 and x < 260) and (y > 50 and y < 80)
tooltip, ccleaner
if (x > 40 and x < 90) and (y > 20 and y < 50)
tooltip, taskmgr
if (x > 110 and x < 150) and (y > 20 and y < 50)
tooltip, control panel
if (x > 170 and x < 220) and (y > 20 and y < 50)
tooltip, logoff
if (x > 240 and x < 290) and (y > 20 and y < 50)
tooltip, shutdown
if (x > 10 and x < 60) and (y > 0 and y < 30)
tooltip, SL
if (x > 80 and x < 130) and (y > 0 and y < 30)
tooltip, Spider
if (x > 150 and x < 200) and (y > 0 and y < 30)
tooltip, blank
if (x > 220 and x < 270) and (y > 0 and y < 30)
tooltip, blank
if (x > 290 and x < 340) and (y > 0 and y < 30)
tooltip, blank
return

launch:
if (x > 140 and x < 190) and (y > 90 and y < 140)
{
run, explorer.exe c:\program files
gui, hide
setTimer, loop, off
tooltip
}
if (x > 100 and x < 150) and (y > 70 and y < 120)
{
run, c:\program files\mozilla Firefox\firefox.exe
gui, hide
setTimer, loop, off
tooltip
}
if (x > 180 and x < 230) and (y > 70 and y < 120)
{
Run, c:\program files\internet explorer\iexplore.exe
gui, hide
setTimer, loop, off
tooltip
}
if (x > 70 and x < 120) and (y > 50 and y < 80)
{
Run, C:\Users\kc\AppData\Local\Google\Chrome\Application\chrome.exe
gui, hide
setTimer, loop, off
tooltip
}
if (x > 140 and x < 190) and (y > 50 and y < 80)
{
gui, hide
setTimer, loop, off
tooltip
}
if (x > 210 and x < 260) and (y > 50 and y < 80)
{
Run, C:\program files\ccleaner\ccleaner.exe
gui, hide
setTimer, loop, off
tooltip
}
if (x > 40 and x < 90) and (y > 20 and y < 50)
{
Run, taskmgr.exe
gui, hide
setTimer, loop, off
tooltip
}
if (x > 110 and x < 150) and (y > 20 and y < 50)
{
Run, Control.exe
gui, hide
setTimer, loop, off
tooltip
}
if (x > 170 and x < 220) and (y > 20 and y < 50)
{
Shutdown, 0
gui, hide
setTimer, loop, off
tooltip
}
if (x > 240 and x < 290) and (y > 20 and y < 50)
{
shutdown, 1
gui, hide
setTimer, loop, off
tooltip
}
if (x > 10 and x < 60) and (y > 0 and y < 30)
{
Run, C:\Program Files\Imprudence\imprudence.exe, --settings settings_imprudence.xml
gui, hide
setTimer, loop, off
tooltip
}
if (x > 80 and x < 130) and (y > 0 and y < 30)
{
Run, c:\Program Files\Microsoft Games\SpiderSolitaire\SpiderSolitaire.exe
gui, hide
setTimer, loop, off
tooltip
}
if (x > 150 and x < 200) and (y > 0 and y < 30)
{
gui, hide
setTimer, loop, off
tooltip
}
if (x > 220 and x < 270) and (y > 0 and y < 30)
{
gui, hide
setTimer, loop, off
tooltip
}
if (x > 290 and x < 340) and (y > 0 and y < 30)
{
gui, hide
setTimer, loop, off
tooltip
}
return

mbutton::
setTimer, loop, 10
gui, show
return

mbutton & rbutton::
WinGet, id, list,,, Program Manager
      Loop, %id%
      {
         StringTrimRight, this_id, id%a_index%, 0
         WinGetTitle, title, ahk_id %this_id%
         WinGetClass, class, ahk_id %this_id%
         WinHide, ahk_id %this_id%
         HWins = %HWins%||%this_id%
       }
run, notepad.exe c:\program files\autohotkey\scripts\script.txt
      Return
   
Lshift & mbutton::
      Loop, Parse, HWins, ||
      WinShow, ahk_id %A_LoopField%
      Return

Lctrl & rbutton::Alttab
return


Last edited by netfun81 on January 16th, 2010, 2:08 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 16th, 2010, 1:10 am 
Offline
User avatar

Joined: April 4th, 2009, 8:19 pm
Posts: 1143
Location: Croatia
You know that I like stuff like this,
so I'll give you a smile;
:D

Tip: Quick showing and hiding Gui when the script starts is visible on my (slow) computer. If this is the case on your computer too, fix it on this way;
Code:
; Replace
Gui, show, w333 h160
Gui, hide

;with
Gui, show, hide w333 h160


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 16th, 2010, 2:12 am 
Offline

Joined: October 28th, 2006, 5:01 pm
Posts: 58
Thanks Learning one, i've updated the original script with your change and a couple other small changes.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 16th, 2010, 7:07 pm 
pretty cool. So many things can be done with autohotkey..it's amazing.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 18th, 2010, 6:34 pm 
Works for me, and quite unique. Plus I like the game of pool so that is a plus :) One thing i noticed if you position just right between two balls you can launch both items, so it works as a multi-launcher--cool.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 18th, 2010, 7:24 pm 
its not working for me :o

Error at line1.

Line text: yb# ( its a y with 2x o's on top and b overlapping with p symbol)
Error: This line does not cotain a recognized action.

This program will exit.

Help pls :( = before

:) = after


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 18th, 2010, 9:05 pm 
Offline

Joined: October 28th, 2006, 5:01 pm
Posts: 58
what version of windows are you using? Ive tested on XP and Vista.

What version of Autohotkey? I'm using 1.0.48.05 which is the latest.

If it still won't work try putting a ; in front of the first 3 lines like this:
;#NoEnv
;SendMode Input
;SetWorkingDir %A_ScriptDir%

save and try again.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 9 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