Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- This program was designed to make a opening files and going to web addresses easier.
- Welcome to the script for the 'Fire Smartbar'.
- Made by dangerdogL2121(code name).
- I put a lot of time in this, so please don't take credit for it.
- This is my first public project!
- Definate bugs: None
- Possible bugs: The gui might not run whatever the user clicks on.
- Less important details:
- Programming language: AutoHotkey
- Total programming time in hours:approx. 10hrs(a really bad estamate)
- Time span from start to finish: 3 days
- Thank you for looking at this!
- Finished 5/3/2013
- */
- #WinActivateForce
- coordmode, pixel, screen
- coordmode,mouse,screen
- coordmode,tooltip,screen
- moveif=
- Varx=
- Vary=
- ColorChoice=
- thing1=(blank)
- thing2=(blank)
- thing3=(blank)
- thing4=(blank)
- thing5=(blank)
- thing6=(blank)
- thing7=(blank)
- thing8=(blank)
- thing9=(blank)
- thing10=(blank)
- inputnum=1
- numthing=1
- Hider=FALSE
- startscreenw=%A_ScreenWidth%
- startscreenw-=350
- IniRead, Hider, %A_ScriptDir%\ddlhelper.ini, Section100, Key1,FALSE
- IniRead, moveif, %A_ScriptDir%\ddlhelper.ini, Section103, Key1
- if moveif = ERROR
- {
- moveif=0
- }
- loop,10
- {
- IniRead, thing%inputnum%, %A_ScriptDir%\ddlhelper.ini, Section%inputnum%, Key1
- if thing%inputnum% = ERROR
- thing%inputnum% = (blank)
- inputnum+=1
- }
- OnMessage(0x201, "WM_LBUTTONDOWN")
- WM_LBUTTONDOWN()
- {
- if A_Gui = 1
- PostMessage, 0xA1, 2 ; WM_NCLBUTTONDOWN
- WinGetPos, Varx, Vary,,, %A_ScriptName%
- IniWrite, %Varx%, %A_ScriptDir%\ddlhelper.ini, Section101, Key1
- IniWrite, %Vary%, %A_ScriptDir%\ddlhelper.ini, Section102, Key1
- moveif := 1
- IniWrite, %moveif%, %A_ScriptDir%\ddlhelper.ini, Section103, Key1
- }
- IniRead, Varx, %A_ScriptDir%\ddlhelper.ini, Section101, Key1
- IniRead, Vary, %A_ScriptDir%\ddlhelper.ini, Section102, Key1
- Gosub, MainGui
- return
- MainGui:
- Gui,Submit
- Gui,Destroy
- IniRead, Varx, %A_ScriptDir%\ddlhelper.ini, Section101, Key1
- IniRead, Vary, %A_ScriptDir%\ddlhelper.ini, Section102, Key1
- WinActivate,%A_ScriptName%
- startscreenw=%A_ScreenWidth%
- startscreenw-=400
- gui, font, s10, Verdana
- Gui,+AlwaysOnTop
- Gui, +ToolWindow -caption
- Gui, Color, EEAA99
- WinSet, TransColor, EEAA99
- Gui, Add, Text, , Thank you for using the Fire Smartbar.`nClick on a blank box to configure it.
- Gui, Add, DropDownList, w350 vColorChoice gcheck altsubmit, hide|Clear a drop down list box|%thing1%|%thing2%|%thing3%|%thing4%|%thing5%|%thing6%|%thing7%|%thing8%|%thing9%|%thing10%
- if Hider = TRUE
- {
- Gui, Show, Hide
- }
- if Hider = FALSE
- {
- if moveif = 1
- {
- Gui, Show, x%Varx% y%Vary%
- }
- else
- {
- Gui, Show, x%startscreenw% y200
- }
- }
- WinActivate,%A_ScriptName%
- return
- check:
- KeyWait,WheelDown
- KeyWait,WheelUp
- Gui,Submit
- ifWinNotActive,%A_ScriptName%
- WinActivate,%A_ScriptName%
- workon=%ColorChoice%
- workon-=2
- if ColorChoice = 1
- {
- MsgBox,To bring the drop down list back type 'unhide'.
- Hider=TRUE
- IniWrite, TRUE, %A_ScriptDir%\ddlhelper.ini, Section100, Key1
- FileSetAttrib, -H, %A_ScriptDir%\ddlhelper.ini
- Gosub, MainGui
- }
- if ColorChoice = 2
- {
- Gosub,Configure
- }
- if ColorChoice > 2
- {
- if thing%workon% != (blank)
- {
- StringLen,dcheck, thing%workon%
- if dcheck > 0
- {
- run,% thing%workon%,,UseErrorLevel
- If ErrorLevel = ERROR
- {
- MsgBox, % thing%workon% "could not be opened."
- ErrorLevel=0
- }
- Gosub, MainGui
- }
- }
- else
- {
- Gosub, choser
- }
- }
- return
- choser:
- WinGetPos,Varx,Vary,,A
- Gui,Submit
- Gui, Destroy
- WinActivate, %A_ScriptName%
- KeyWait,WheelDown
- KeyWait,WheelUp
- ifWinNotActive,%A_ScriptName%
- WinActivate,%A_ScriptName%
- startscreenw=%A_ScreenWidth%
- startscreenw-=200
- okbutton=startscreenw
- okbutton+=100
- numthing=%ColorChoice%
- EnvSub, numthing, 1
- Gui,+AlwaysOnTop
- WinSet, TransColor, EEAA99
- Gui, +ToolWindow -caption
- gui, font, s10, Verdana
- Gui, Color, EEAA99
- Gui, Add, Text,, Select shortcut type.
- Gui, Add, Radio, vMyRadio altsubmit, File or folder
- Gui, Add, Radio,, Internet Address
- Gui, Add, Radio,, Make box blank
- Gui, Add, Button,x%okbutton% gbuttonok, OK
- Gui, Show, x%Varx% y%Vary%
- return
- buttonok:
- Gui,Submit
- ifWinNotActive,%A_ScriptName%
- WinActivate,%A_ScriptName%\
- if MyRadio = 0
- {
- Gosub,MainGui
- }
- if MyRadio = 1
- {
- FileSelectFile, thing%numthing%
- if ErrorLevel = 1
- {
- thing%numthing%=(blank)
- ErrorLevel=0
- }
- IniWrite, % thing%numthing%, %A_ScriptDir%\ddlhelper.ini, Section%numthing%, Key1
- FileSetAttrib, -H, %A_ScriptDir%\ddlhelper.ini
- Gosub, MainGui
- }
- if MyRadio = 2
- {
- InputBox, thing%numthing%, Item%numthing%, Please insert what internet address`nyou want the Item%numthing%.
- if ErrorLevel = 1
- {
- thing%numthing%=(blank)
- ErrorLevel=0
- }
- if thing%numthing% =
- {
- thing%numthing%=(blank)
- }
- IniWrite, % thing%numthing%, %A_ScriptDir%\ddlhelper.ini, Section%numthing%, Key1
- FileSetAttrib, -H, %A_ScriptDir%\ddlhelper.ini
- Gosub, MainGui
- }
- if MyRadio = 3
- {
- thing%numthing% = (blank)
- IniWrite, % thing%numthing%, %A_ScriptDir%\ddlhelper.ini, Section%numthing%, Key1
- Gosub, MainGui
- }
- return
- :*B0:unhide::
- IniWrite, FALSE, %A_ScriptDir%\ddlhelper.ini, Section100, Key1
- FileSetAttrib, -H, %A_ScriptDir%\ddlhelper.ini
- Hider=FALSE
- Gosub, MainGui
- return
- configure:
- Gui, Destroy
- WinActivate,%A_ScriptName%
- KeyWait,WheelDown
- KeyWait,WheelUp
- startscreenw=%A_ScreenWidth%
- startscreenw-=350
- Gui,+AlwaysOnTop
- WinSet, TransColor, EEAA99
- Gui, +ToolWindow -caption
- gui, font, s10, Verdana
- Gui, Color, EEAA99
- Gui, Add, Text, , Select the box you want to change.
- Gui, Add, DropDownList, w300 vConfigure2 gchanger altsubmit, back|%thing1%|%thing2%|%thing3%|%thing4%|%thing5%|%thing6%|%thing7%|%thing8%|%thing9%|%thing10%
- Gui, Show, x%Varx% y%Vary%
- return
- changer:
- Gui,Submit
- ifWinNotActive,%A_ScriptName%
- WinActivate,%A_ScriptName%
- numthing=%Configure2%
- numthing-=1
- if Configure2 = 1
- {
- Gui,Destroy
- Gosub, MainGui
- }
- if Configure2 > 1
- {
- thing%numthing%=(blank)
- Gosub,MainGui
- }
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement