 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
netfun81
Joined: 28 Oct 2006 Posts: 58
|
Posted: Fri Jan 15, 2010 11:40 pm Post subject: Picture Launcher |
|
|
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:
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 Sat Jan 16, 2010 1:08 am; edited 1 time in total |
|
| Back to top |
|
 |
Learning one
Joined: 04 Apr 2009 Posts: 1001 Location: Croatia
|
Posted: Sat Jan 16, 2010 12:10 am Post subject: |
|
|
You know that I like stuff like this,
so I'll give you a smile;
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 |
|
|
| Back to top |
|
 |
netfun81
Joined: 28 Oct 2006 Posts: 58
|
Posted: Sat Jan 16, 2010 1:12 am Post subject: |
|
|
| Thanks Learning one, i've updated the original script with your change and a couple other small changes. |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Jan 16, 2010 6:07 pm Post subject: |
|
|
| pretty cool. So many things can be done with autohotkey..it's amazing. |
|
| Back to top |
|
 |
Josh Guest
|
Posted: Mon Jan 18, 2010 5:34 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Guest2 Guest
|
Posted: Mon Jan 18, 2010 6:24 pm Post subject: |
|
|
its not working for me
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 |
|
| Back to top |
|
 |
netfun81
Joined: 28 Oct 2006 Posts: 58
|
Posted: Mon Jan 18, 2010 8:05 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|