#beginheader
#
# starthere is an open source application launcher.
# licensed under GNU GPL 3.0 -
https://opensource.org/licenses/GPL-3.0
# all copies of this source code must include this header
#
# application name: startHERE
# copyright: Chris Gingerich 2018
#
https://theblindhouse.com
# chris@theblindhouse.com
#
#endheader
#msg#
#version HISTORY#
#1.10.10.2018 - removed the code to remove the task icon
#1.9.13.2018 - Added option to return to favorites when hidden
# - fixed favs bug. If no favs were set it would error
# - fixed display issue when changing colors
#1.9.10.2018 - Went back to old CLOSE code and added ProEject.exe as backup
#1.9.7.2018 - Removing old code, updating and added comments.
# - Fixed wallpaper code
#1.9.6.2018 - Changed name to startHERE
#1.9.5.2018 - Updated fav numbers to 1 - 12 instead of 01 - 12
#1.8.31.2018 - Fixed cancelButton bug
# - Added killtask @path(%0).exe to close main app to prevent sound
# - Hide table1 when loading
#1.8.29.2018 - Moved favorite button over a bit
# - Changed static menu items to buttons
#1.8.27.2018# - added ProEject.exe to close all portable apps
#1.8.21.2018# - use nircmd to kill processes on close.
#1.7.20.2018 - added use Systrayrefresh.exe when closing startHERE and portable apps
#1.6.28.2018# - added optional taskbar button using dummy dialog #/1.6.28.2018#
#1.6.25.2018# - added "faux" banner to search edit box #/1.6.25.2018#
#1.6.22.2018# - updated UI to look more like PortableApps.com app #/1.6.22.2018#
#1.6.21.2018# - updated search to work without having to clear it first #/1.6.21.2018#
#1.6.14.2018# - added search button +open with dlg - open with menu #/1.6.14.2018#
#/msg#
# TO USE:
#
# Copy startHERE.exe to the root of your USB drive (or folder)
# and double click to run.
# table commands taken from extTable.dsu [
http://www.vdsworld.com/download.php?id=508&sid=4260192f85ee22d96d4eaef44340ec3e]
# optional command line apps:
# proeject.exe
https://www.softpedia.com/get/System/Hard-Disk-Utils/ProEject.shtml
# wallpaperchanger.exe [
https://github.com/philhansen/WallpaperChanger/releases/]
#set option defaults
option ERRORTRAP,ERRORBRANCH
option DECIMALSEP,.
option FIELDSEP,|
option SLEEPTIME,50
# define commands and functions
#define command,wallpaper,background,indent,disenable,favs,cubanner,tGroup
#define function,TaskExists,xml,getCategory,mkWideCharStr,tGroup,rgb2dec,rgb2hex,sshex2dec
#if WallpaperChanger.exe is found set to T [true]
#if not set var to F [false]
if @file(@path(%0)WallpaperChanger.exe)
%%wallpaperchanger = T
else
%%wallpaperchanger = F
end
#if ProEject.exe is found set to T [true]
#if not set var to F [false]
if @file(@path(%0)ProEject.exe)
%%proeject = T
else
%%proeject = F
end
#set "global" variables
%%var0 = "startHERE"
title %%var0
%%var1 = PL_Main
%%var2 = "0"
%%var3 = @verinfo(%0,v)
%%var4 = "September 2018"
%%var7 = "Program launcher for removable media"
%%var8 = Chris Gingerich
%%var9 = Freeware - Home/Business
%%var10 = N/A
%%var11 = N/A
%%var12 = chris@chr(64)TheBlindHouse.com
%%var13 =
https://TheBlindHouse.com/startHere
%%var14 = 2018
%%var15 = "startHERE"
%%wallpaper = @path(%0)startHERE.jpg
if @equal(%1,/A)
goto ABOUTBOX
stop
end
if @winexists(#PL_Main)
window NORMAL,#PL_Main
window ACTIVATE,#PL_Main
exit
end
list CREATE,1
list CREATE,2
list CREATE,3
list CREATE,4
list CREATE,5
list CREATE,6,sorted
list CREATE,7,sorted
inifile OPEN,@path(%0)%%var15".ini",XML
%t = @iniread(Settings,T)
%l = @iniread(Settings,L)
%w = @iniread(Settings,W)
%h = @iniread(Settings,H)
if @null(%T)
%t = 40
%l = 40
%w = 295
%h = 330
%%var16 = 1
inifile WRITE,Settings,T,%T
inifile WRITE,Settings,L,%L
inifile WRITE,Settings,W,%W
inifile WRITE,Settings,H,%H
inifile WRITE,Settings,APCC,%%var16
end
#%%var17 = @iniread(Settings,TBVW)
%%var16 = @iniread(Settings,APCC)
%%hideport = @iniread(Settings,hidePort)
%%taskbarbutton = @iniread(Settings,taskbarButton)
%%return = @iniread(Settings,return)
%%color1 = @iniread(Settings,Color1,gray)
%%color2 = @iniread(Settings,Color2,gray)
%%category = @new(list)
%%favbuttons = @new(list)
#taskbar button
dialog CREATE,startHERE,100000000,100000000,240,160,CLASS PL_Dummy
dialog SHOW
if @not(%%taskbarButton)
window hide,#PL_Dummy
end
window activate,#PL_Main
#make category list
list add,%%category,FAVORITES
if @iniread(Settings,Category)
%%cattemp = @new(list)
%%cats = @trim(@iniread(Settings,Category))
if @unequal(@substr(%%cats,1,1),",")
%%cats = ","%%cats
end
list assign,%%catTemp,@strrep(%%cats,",",@cr(),ALL)
list append,%%category,%%catTemp
list close,%%catTemp
else
list add,%%category,Development
list add,%%category,Graphics and Pictures
list add,%%category,Utilities
list add,%%category,Office
list add,%%category,Music and Video
list add,%%category,Internet
list add,%%category,Games
list add,%%category,RDP
end
list add,%%category,Other
list add,%%category,Search Results
%%var18 = @sysinfo(SCREENWIDTH)
%%var19 = @fsub(@sysinfo(SCREENHEIGHT),100)
%%var20 = 1
#change wallpaper if needed
wallpaper start
parse "%t;%l;%w;%h",@winpos(#Shell_TrayWnd,TLWH)
%%sh = @sysinfo(screenheight)
%%sw = @sysinfo(screenwidth)
%%width = 400
%%height = 500
if @greater(%t,0)
%%top = @diff(@diff(%%sh,%%height),%h)
else
%%top = @diff(%%sh,%%height)
end
%%left = @diff(%%sw,%%width)
dialog CREATE,startHERE,%%top,%%left,400,500,CLASS PL_Main,NOSYS,NOTITLE
#dialog create,startHERE,-1,0,400,500,CLASS PL_Main,NOSYS,NOTITLE
rem *** Modified by Dialog Designer on 8/27/2018 - 15:09 ***
dialog ADD,STYLE,STYLE7,Arial,6,,,silver
dialog ADD,STYLE,STYLE6,Arial,10,,,silver
dialog ADD,STYLE,STYLE5,Arial,10,,,WHITE
dialog ADD,STYLE,STYLE4,Arial,14,,12ABDE,WHITE
dialog ADD,STYLE,STYLE3,Arial,14,,,WHITE
dialog ADD,STYLE,STYLE8,Arial,14,,,
dialog ADD,STYLE,STYLE2,Webdings,16,B,,white
#dialog ADD,SHAPE,back,0,0,400,500,%%color,4B4B4B,,RECTANGLE
dialog ADD,GRADIENT,back,0,0,400,500,%%color1,%%color2,,TOPTOBOTTOM
dialog ADD,STYLE,STYLE1,Small Fonts,7,,BACKGROUND,FORGROUND
dialog ADD,STYLE,STYLE0,Arial,8,B,,FORGROUND
dialog ADD,TABLE,TABLE1,28,2,250,408,Name[220L]|Version[1]|Description[1]|Path[1L]|File[1R]|Auto Start[1C]|Close Start[1C]|Excluded[1]|Category[1]|Associations[1],,CLICK,DBLCLICK
dialog ADD,GRADIENT,GRADIENT0,28,2,250,440,white,white,,BOTTOMTOTOP
dialog ADD,GRADIENT,GRADIENT1,7,257,2,465,GRAY,SILVER,,BOTTOMTOTOP
#loading apps text
dialog add,Text,loading2,2,2,250,22,Loading Apps...,,style8
dialog add,Text,loading,3,3,250,22,Loading Apps...,,style3
dialog ADD,EDIT,search,2,2,250,24,,,EXIT
dialog add,EDIT,searchBanner,2,2,250,24,Enter search terms...,,STYLE6,CLICK
dialog ADD,button,CANCEL,0,0,0,0,Cancel
dialog ADD,button,searchBtn,0,0,0,0,,,default
dialog add,Text,startHERE2,9,281,120,21,startHERE,,style8,click
dialog add,Text,startHERE,8,280,120,21,startHERE,,style3,click
dialog add,button,documents,36,263,120,27,Documents,,style4
dialog add,button,music,66,263,120,27,Music,,STYLE4
dialog ADD,button,Pictures,96,263,120,27,Pictures,,style4
dialog ADD,button,Videos,126,263,120,27,Videos,,STYLE4
dialog ADD,button,Explore,156,263,120,27,Explore,,STYLE4
dialog ADD,SHAPE,Sep1,189,257,135,1,4B4B4B,4B4B4B,,RECTANGLE
dialog ADD,button,Apps,200,263,120,27,Apps,,STYLE4
dialog ADD,button,Options,230,263,120,27,Options,,STYLE4
dialog ADD,exttext,space,476,5,250,24,,,style5
dialog ADD,text,version,460,350,,,%%var3,,style7
dialog ADD,SHAPE,close,473,258,135,24,%%color2,%%color1,,RECTANGLE,CLICK,hand
dialog ADD,TEXT,closeText,472,312,,,r,,STYLE2,CLICK,HAND
dialog ADD,BUTTON,favs,436,2,250,32,@chr(60) Favorites
dialog ADD,BUTTON,all,436,2,250,32,All Programs >
dialog add,taskicon,ti,,startHERE
#for fav buttons
dialog ADD,BUTTON,fav0,29,2,250,32,
dialog ADD,BUTTON,fav1,62,2,250,32,
dialog ADD,BUTTON,fav2,95,2,250,32,
dialog ADD,BUTTON,fav3,128,2,250,32,
dialog ADD,BUTTON,fav4,161,2,250,32,
dialog ADD,BUTTON,fav5,194,2,250,32,
dialog ADD,BUTTON,fav6,227,2,250,32,
dialog ADD,BUTTON,fav7,260,2,250,32,
dialog ADD,BUTTON,fav8,293,2,250,32,
dialog ADD,BUTTON,fav9,326,2,250,32,
dialog ADD,BUTTON,fav10,359,2,250,32,
dialog ADD,BUTTON,fav11,392,2,250,32,
dialog hide,fav0
dialog hide,fav1
dialog hide,fav2
dialog hide,fav3
dialog hide,fav4
dialog hide,fav5
dialog hide,fav6
dialog hide,fav7
dialog hide,fav8
dialog hide,fav9
dialog hide,fav10
dialog hide,fav11
dialog hide,table1
dialog hide,search
dialog hide,searchBanner
dialog show
#calculate space on drive
%%free = @format(@fdiv(@volinfo(@substr(@path(%0),1,1),F),1048576),100.2)
%%total = @format(@fdiv(@volinfo(@substr(@path(%0),1,1),S),1048576),100.2)
%%diff = @fsub(%%total,%%free)
%%dif = @format(@fmul(@fdiv(%%diff,%%total),100),100.0)
%%dif = @fsub(100,%%dif)
dialog set,space,@substr(@path(%0),1,3) - [@trim(%%free)GB Free / @trim(%%dif)"%" of @trim(%%total)GB]
dialog set,table1,"Loading apps, please wait..."
%%startup = T
gosub moveitbaby
#enable and show groups on table
tgroup ENABLEGROUPVIEW,table1
%x = 0
repeat
%%group = @trim(@item(%%category,%x))
if %%group
tgroup INSERTGROUP,TABLE1,@getCategory(%%group),@getCategory(%%group),%%group
end
%x = @succ(%x)
until @equal(%x,@count(%%category))
gosub REFRESHLIST
gosub REFRESHTABLE
%%startup =
#run any startup applications
if @text(7)
list SEEK,7,0
repeat
list SEEK,5,0
if @match(5,@item(7))
option FIELDSEP,@tab()
parse "%%var21;%%var22;%%var23;%%var24;%%var25",@item(5)
if @not(@taskexists(%%var25))
shell OPEN,%%var24"\"%%var25,,%%var24,
end
end
%%var26 = @next(7)
until @null(@item(7))
end
#set hotkey to show menu
hotkey add,Alt+Space
if @text(%%favButtons)
#if there are favs
gosub favButtons
else
#if no favs then hide < Favorites and All Programs >
#and make table1 a little longer
dialog hide,favs
dialog hide,all
dialog setpos,TABLE1,28,2,250,440
end
#hide loading apps text
dialog hide,loading2
dialog hide,loading
:evloop
:EVENTLOOP
if @not(%%timerOff)
#if associations menu is not open, then use the timer
wait EVENT,0.1
end
%e = @event()
if @greater(@pos(".",%e),0)
%p = @succ(@pos(".",%e))
#%t = @substr(%e,%p,@diff(@len(%e),4))
%%thecategory = @trim(@substr(%e,%p,@diff(@len(%e),4)))
#info %%theCategory
goto updateCategory
elsif @equal(@strdel(%e,1,-5),ENTER)
dialog hide,@substr(%e,1,-5)Text
dialog show,@substr(%e,1,-5)TextOver
elsif @equal(@strdel(%e,1,-5),LEAVE)
dialog hide,@substr(%e,1,-5)TextOver
dialog show,@substr(%e,1,-5)Text
elsif @equal(@strdel(%e,1,-6),BUTTON)
if @equal(%e,ALLBUTTON)
favs hide
elsif @equal(%e,FAVSBUTTON)
favs show
elsif @equal(%e,searchBtnBUTTON)
goto searchBtnButton
elsif @equal(%e,DocumentsBUTTON)
goto DocumentsClick
elsif @equal(%e,MusicBUTTON)
goto MusicClick
elsif @equal(%e,PicturesBUTTON)
goto PicturesClick
elsif @equal(%e,VideosBUTTON)
goto VideosClick
elsif @equal(%e,ExploreBUTTON)
goto ExploreClick
elsif @equal(%e,AppsBUTTON)
goto AppsClick
elsif @equal(%e,OptionsBUTTON)
goto OptionsClick
elsif @equal(%e,cancelButton)
goto cancelButton
else
dialog CURSOR,WAIT
disenable disable
#get the fav number
%n = @strslice(%e,fav,button)
shell OPEN,@item(%%favButtons,%n),,@path(@item(%%favButtons,%n)),
wait "0.5"
disenable enable
dialog CURSOR
end
else
goto %E
end
goto EVENTLOOP
:startHEREClick
:startHERE2Click
shell open,
http://starthere.theblindhouse.com
%e = @event()
goto evloop
:favs
#if there are fav buttons
if @text(%%favButtons)
%x = 0
repeat
dialog %1,fav%x
%x = @succ(%x)
until @equal(%x,@count(%%favButtons))
end
if @equal(%1,hide)
dialog hide,all
dialog show,favs
dialog show,table1
dialog show,search
dialog show,searchBanner
else
dialog show,all
dialog hide,favs
dialog hide,table1
dialog hide,search
dialog hide,searchBanner
end
exit
:searchBannerClick
dialog hide,searchBanner
dialog focus,search
goto evloop
:searchEXIT
if @not(@trim(@dlgtext(search)))
dialog show,searchBanner
end
goto evloop
:hotkey
#dialog focus,search
:tiClick
gosub moveItBaby
if @equal(@click(B),RIGHT)
dialog popup,Show startHERE|-|Exit
else
goto Show startHEREMENU
end
goto evloop
:Show startHEREMENU
window normal,#PL_Main
window activate,#PL_Main
goto evloop
:CLOSE_ORG
list CLEAR,1
list CLEAR,2
list CLEAR,3
if %%var16
list TASKLIST,1,NI
if @text(1)
list SEEK,1,0
repeat
list CLEAR,2
option FIELDSEP,|
parse "%A;%B",@item(1)
list MODULES,2,%A
if @equal(@substr(@item(2,0),1,1),@substr(%0,1,1))
if @unequal(@item(2,0),%0)
list ADD,3,@item(2,0)|%B
end
end
%%var26 = @next(1)
until @null(@item(1))
end
if @text(3)
%r = @msgbox(You have programs running that run from your removable drive. Would you like me to close these programs?@cr()@cr()WARNING: Please make sure to save your work!! This will not ask you to save.,startHERE,$123)
if @equal(%R,6)
disenable disable
list SEEK,3,0
repeat
option FIELDSEP,|
parse "%A;%B",@item(3)
wait "0.5"
dialog set,search,Closing: @name(%A).@ext(%A)
killtask %B
wait "0.5"
%%var26 = @next(3)
until @null(@item(3))
elsif @equal(%R,2)
goto evloop
end
end
end
window activate,#PL_Main
if @equal(@winpos(#%%var1,S),1)
%t = @winpos(#%%var1,T)
%l = @winpos(#%%var1,L)
%w = @dlgpos(,W)
%h = @dlgpos(,H)
end
inifile OPEN,@path(%0)%%var15".ini",XML
inifile WRITE,Settings,T,%T
inifile WRITE,Settings,L,%L
inifile WRITE,Settings,W,%W
inifile WRITE,Settings,H,%H
inifile close
wallpaper end
#registry delete,HCR,AllFilesystemObjects\shell\Open With startHERE
if %%openWithContextMenu
if @file(@path(%0)startHEREContextRem.exe)
shell runas,@chr(34)startHEREContextRem.exe@chr(34),runasadmin,@chr(34)@Path(%0)@chr(34)
end
end
window activate,#PL_Dummy
window close,##PL_Dummy
stop
:CLOSE_old
inifile close
#if ProEject.exe is found and Close apps is set
if @equal(%%proEject,T)
if %%var16
%r = @msgbox(Close ALL running appd from P:?@cr()@cr()WARNING: Please make sure to save your work!! This will not ask you to save.,startHERE,$123)
if @equal(%R,6)
wallpaper end
run @path(%0)ProEject.exe
dialog remove,ti
killtask @name(%0).exe
stop
elsif @equal(%R,7)
wallpaper end
dialog remove,ti
killtask @name(%0).exe
stop
end
else
wallpaper end
dialog remove,ti
killtask @name(%0).exe
stop
end
else
#if not then just close startHERE
wallpaper end
dialog remove,ti
killtask @name(%0).exe
stop
end
goto evloop
:closeClick
:closeTextClick
:ExitMENU
:Exit startHEREMENU
:CLOSE
list CLEAR,1
list CLEAR,2
list CLEAR,3
if %%var16
list TASKLIST,1,NI
if @text(1)
list SEEK,1,0
repeat
list CLEAR,2
option FIELDSEP,|
parse "%A;%B",@item(1)
list MODULES,2,%A
if @equal(@substr(@item(2,0),1,1),@substr(%0,1,1))
if @unequal(@item(2,0),%0)
list ADD,3,@name(@item(2,0)).@ext(@item(2,0))@tab()@path(@item(2,0))@tab()%B
end
end
%%var26 = @next(1)
until @null(@item(1))
end
if @text(3)
%r = @msgbox(You have programs running that run from your removable drive. Would you like me to close these programs?@cr()@cr()WARNING: Please make sure to save your work!! This will not ask you to save.,startHERE,$123)
if @equal(%R,6)
run @path(%0)SysTrayRefresh.exe
disenable disable
dialog CREATE,Closing Apps,-1,0,250,224,NOSYS
rem *** Modified by Dialog Designer on 7/5/2018 - 09:26 ***
dialog ADD,TABLE,TABLE1,0,0,250,189,Name[240]|Path[0]|ID[0]
#dialog ADD,BUTTON,closeAll,193,3,96,24,Force Close All
dialog ADD,BUTTON,Cancel,193,202,47,24,Cancel
dialog SHOW
list assign,table1,3
%x = 0
option FIELDSEP,@tab()
repeat
%e = @event()
if @equal(%e,CancelButton)
goto close_CancelButton
#elsif @equal(%e,closeAllButton)
end
parse "%A;%B;%C",@item(table1,0)
if @not(@greater(@pos(Portable,%A),0))
while @taskexists(%A)
#wait "0.5"
#dialog set,search,Closing: %A
runh taskkill /IM %c /F,wait
#killtask %C
#wait "0.5"
wend
end
list delete,table1,0
until @null(@text(table1))
killtask SysTrayRefresh.exe
#run ProEject.exe as a backup to close all other apps not closed
#by the above code.
run @path(%0)ProEject.exe
elsif @equal(%R,2)
goto evloop
end
end
end
:close_CancelButton
window activate,#PL_Main
#dialog remove,ti
wallpaper end
#registry delete,HCR,AllFilesystemObjects\shell\Open With startHERE
#if %%openWithContextMenu
# if @file(@path(%0)startHEREContextRem.exe)
# shell runas,@chr(34)startHEREContextRem.exe@chr(34),runasadmin,@chr(34)@Path(%0)@chr(34)
# end
#end
window activate,#PL_Dummy
window close,##PL_Dummy
killtask @name(%0).exe
stop
:RESIZE
gosub MOVEITBABY
goto EVENTLOOP
:timer
if @equal(@winactive(C),#PL_Dummy)
gosub moveItBaby
goto Show startHEREMENU
end
if %%openWithDlg
if @unequal(@winactive(C),#openWithDlg_Wnd)
%%openwithdlg =
dialog close
repeat
until @not(@event())
end
goto evloop
end
if @unequal(@winactive(C),#PL_Main)
window hide,#PL_Main
if @equal(%%return,1)
#clear any search
if %%searching
dialog show,searchBanner
dialog clear,search
gosub refreshList
gosub refreshTable
%%searching =
end
%1 = show
gosub favs
end
end
# Check to see if something was entered into the search box and run the search
#if @not(@zero(@sendmsg(@winexists(~search),$0B8,0,0)))
# gosub search
#end
if @regread(default,startHERE,OpenWith)
%%openwithfile = @regread(default,startHERE,OpenWith)
if @file(%%openWithFile)
registry write,default,startHERE,OpenWith,
goto openWith
end
end
goto evloop
:cancelBUTTON
:clearSearchButton
%%searching =
#dialog show,searchBtn
dialog show,searchBanner
dialog clear,search
gosub refreshList
gosub refreshTable
goto evloop
:searchBtnButton
:Search
#dialog hide,searchBtn
%%srh = @dlgtext(search)
if %%srh
%%searching = T
if @greater(@count(5),0)
list clear,table1
%x = 0
%z = 0
repeat
%t = @pos(%%srh,@item(5,%x))
if @greater(%t,0)
option FIELDSEP,@tab()
parse "%%var21;%%var22;%%var23;%%var24;%%var25",@item(5,%x)
option FIELDSEP,|
if @file(%%var24"\"@name(%%var25)".ico")
list ADD,TABLE1,@item(5,%x)|%%var24"\"@name(%%var25)".ico"
else
list ADD,TABLE1,@item(5,%x)|%%var24"\"%%var25
end
tgroup MOVEITEMTOGROUP,TABLE1,@getCategory(Search),%z
%z = @succ(%z)
#list add,table1,@item(5,%x)
end
%x = @succ(%x)
until @equal(%x,@count(5))
end
else
%%searching =
gosub refreshList
gosub refreshTable
end
rem -- Clear "text modified" flag --
%z = @sendmsg(@winexists(~search),$0B9,0,0)
goto evloop
:moveItBaby
#%%startposx = @diff(@mousepos(x),@dlgpos(,L))
#%%startposy = @diff(@mousepos(y),@dlgpos(,T))
if @not(%%startup)
window position,#PL_Main,,@mousepos(X)
end
%%pos = @DIFF(@WINPOS(#Shell_TrayWnd,T),@DLGPOS(,H))
if @GREATER(@SUM(@WINPOS(#PL_Main,T),@WINPOS(#PL_Main,H),40),@WINPOS(#Shell_TrayWnd,T))
%%pos = @DIFF(@WINPOS(#Shell_TrayWnd,T),@SUM(@WINPOS(#PL_Main,H),3))
window POSITION,#PL_Main,%%POS
end
%%pos = @DIFF(@SYSINFO(SCREENWIDTH),@DLGPOS(,W))
if @GREATER(@SUM(@WINPOS(#PL_Main,L),@WINPOS(#PL_Main,W),40),@SYSINFO(SCREENWIDTH))
%%pos = @DIFF(@SYSINFO(SCREENWIDTH),@SUM(@WINPOS(#PL_Main,W),4))
window POSITION,#PL_Main,,%%POS
end
if @GREATER(40,@WINPOS(#PL_Main,L))
window POSITION,#PL_Main,,4
end
if @GREATER(40,@WINPOS(#PL_Main,T))
window POSITION,#PL_Main,4
end
if @unequal(@winactive(C),#PL_Main)
window hide,#PL_Main
end
exit
:TABLE1CLICK
if @equal(@click(B),RIGHT)
option FIELDSEP,@tab()
parse "%%var21;%%var22;%%var23;%%var24;%%exe;%%as;%%cs;%%ex;%%cat;%%assoc",@item(TABLE1)
#%%openwithcontextmenu = @regread(default,startHERE,contextMenu)
%%appsettings = App Settings >|Exclude App;;;;;%%ex|Autostart;;;;;%%as|Hide\Show Excluded Apps|Edit name and description|Associations|Extract Icon|<
%%categorymenu =
%x = 0
%c = 0
%%cat =
repeat
if @unequal(@item(%%category,%x),Search Results)
%%cat = @trim(@item(%%category,%x))
if %%cat
%%categorymenu = %%categoryMenu|%c. %%cat
%c = @succ(%c)
end
end
%x = @succ(%x)
until @equal(%x,@count(%%category))
#favorite|development|games|graphics and Pictures|Internet|Music and Video|Office|Utilities|RDP|Other
%%menu = Explore Here|-|Category >|%%categoryMenu|-|A. Reset|-|Edit Categories|<|%%appSettings|-|Help!|startHERE information
dialog POPUP,%%menu
end
option FIELDSEP,|
goto EVENTLOOP
:AppsClick
dialog popup,Edit Categories|-|Install application|Download new app|Refresh list
goto evloop
:Download new appMenu
shell open,
https://portableapps.com/apps
goto evloop
:Color 1Menu
inifile OPEN,@path(%0)%%var15".ini",XML
%%color1 = @colordlg(%%color1)
if @ok()
dialog set,back,%%color1;%%color2
dialog set,close,%%color2;%%color1
inifile write,Settings,Color1,%%color1
#Hide and show dialog to refresh UI
window hide,#PL_Main
window normal,#PL_Main
window activate,#PL_Main
end
inifile close
goto evloop
:Color 2Menu
inifile OPEN,@path(%0)%%var15".ini",XML
%%color2 = @colordlg(%%color2)
if @ok()
dialog set,back,%%color1;%%color2
dialog set,close,%%color2;%%color1
inifile write,Settings,Color2,%%color2
#Hide and show dialog to refresh UI
window hide,#PL_Main
window normal,#PL_Main
window activate,#PL_Main
end
inifile close
goto evloop
:OptionsClick
%%startheresettings = Close apps on exit;;;;;%%var16|Hide Portable from name;;;;;%%hidePort|Taskbar Button;;;;;%%taskbarButton|Return to favorites when hidden;;;;;%%return|-|Color 1|Color 2|-|About
#use Open With Context Menu;;;;;%%openWithContextMenu
dialog popup,%%startHERESettings
goto evloop
:Return to favorites when hiddenMENU
inifile OPEN,@path(%0)%%var15".ini",XML
if %%return
inifile WRITE,Settings,return
%%return =
else
inifile WRITE,Settings,return,1
%%return = 1
end
inifile close
goto evloop
:aboutMenu
run %0 /A
goto evloop
:Edit CategoriesMENU
inifile OPEN,@path(%0)%%var15".ini",XML
%%cats = @trim(@iniread(Settings,Category,"Development,Graphics and Pictures,Utilities,Office,Music and Video,Internet,Games"))
inifile close
#if %%cats
%i = @input(Categories [comma sep]:,%%cats)
if @ok()
if @not(%i)
warn No categories set. Using default.
%i = "Development,Graphics and Pictures,Utilities,Office,Music and Video,Internet,Games"
end
inifile OPEN,@path(%0)%%var15".ini",XML
inifile write,Settings,Category,%i
list clear,%%category
list add,%%category,FAVORITES
if @iniread(Settings,Category)
%%cattemp = @new(list)
if @unequal(@substr(%i,1,1),",")
%i = ","%i
end
list assign,%%catTemp,@strrep(%i,",",@cr(),ALL)
list append,%%category,%%catTemp
list close,%%catTemp
end
list add,%%category,Other
list add,%%category,Search Results
inifile close
#need to remove the table and add back
dialog remove,table1
dialog ADD,TABLE,TABLE1,28,2,250,408,Name[220L]|Version[1]|Description[1]|Path[1L]|File[1R]|Auto Start[1C]|Close Start[1C]|Excluded[1]|Category[1]|Associations[1],,CLICK,DBLCLICK
tgroup ENABLEGROUPVIEW,table1
%x = 0
repeat
%%group = @trim(@item(%%category,%x))
if %%group
tgroup INSERTGROUP,TABLE1,@getCategory(%%group),@getCategory(%%group),%%group
end
%x = @succ(%x)
until @equal(%x,@count(%%category))
gosub refreshList
gosub refreshTable
end
#end
goto evloop
:Use Open With Context MenuMENU
inifile OPEN,@path(%0)%%var15".ini",XML
if @iniread(Settings,openWithContextMenu)
if @file(@path(%0)startHEREContextRem.exe)
shell runas,@chr(34)@path(%0)startHEREContextRem.exe@chr(34),runasadmin,@chr(34)@Path(%0)@chr(34)
inifile write,Settings,openWithContextMenu
%%openwithcontextmenu =
end
else
if @file(@path(%0)startHEREContextAdd.exe)
shell runas,@chr(34)@path(%0)startHEREContextAdd.exe@chr(34),runasadmin,@chr(34)@Path(%0)@chr(34)
inifile write,Settings,openWithContextMenu,T
%%openwithcontextmenu = T
end
end
inifile close
goto evloop
:dragdrop
%%openwith =
%%dd = @new(list)
list dropfiles,%%dd
%%openwithfile = @item(%%dd)
list close,%%dd
goto openWith
:openWith
%%openwithdlg = T
if %%openWithFile
%%openwithmenu =
%%openwith =
%%dd = @new(list)
list assign,%%dd,TABLE1
dialog CREATE,Open With...,-1,0,200,256,CLASS openWithDlg_Wnd,NOSYS,smallcap,ontop
rem *** Modified by Dialog Designer on 6/13/2018 - 13:39 ***
dialog ADD,TABLE,openWithList,0,0,200,256,App[200]|Path[0],,,dblclick
dialog SHOW
%%openwithext = @ext(%%openWithFile)
%x = 0
%c = 0
repeat
option fieldsep,@tab()
parse "%%var21;%%var22;%%var23;%%var24;%%exe;%%as;%%cs;%%ex;%%cat;%%assoc",@item(%%dd,%x)
if @greater(@pos(%%openWithExt,%%assoc),0)
option FIELDSEP,|
if @file(%%var24"\"@name(%%var25)".ico")
%%ico = %%var42"\"@name(%%exe)".ico"
else
%%ico = %%var24"\"%%exe
end
list add,openWithList,%%var21@tab()%%var24\%%exe@fsep()%%ico
#used for only single associated extension
%%openwith = @chr(34)%%var24\%%exe@chr(34) @chr(34)%%openWithFile@chr(34)
%c = @succ(%c)
end
%x = @succ(%x)
until @equal(%x,@count(%%dd))
list close,%%dd
dialog show
end
#if there is only 1 app associated, then open with that
if @equal(@count(openWithList),1)
run @chr(34)@item(openWithList,0,1)@chr(34) @chr(34)%%openWithFile@chr(34)
%%openwithdlg =
dialog close
repeat
until @not(@event())
goto evloop
end
repeat
#window ontop,openWithDlg_Wnd
window normal,openWithDlg_Wnd
window activate,openWithDlg_Wnd
until @equal(@winactive(C),#openWithDlg_Wnd)
goto evloop
:openWithListDblClick
if @item(openWithList)
run @chr(34)@item(openWithList,,1)@chr(34) @chr(34)%%openWithFile@chr(34)
%%openwithdlg =
dialog close
repeat
until @not(@event())
end
goto evloop
:AssociationsMenu
%%timeroff = T
dialog CREATE,Associations - %%var21,-1,0,333,185,NOSYS,ONTOP
rem *** Modified by Dialog Designer on 6/11/2018 - 09:36 ***
dialog ADD,GROUP,GROUP1,5,5,320,146,Associated file tyes
dialog ADD,EDIT,associations,24,15,300,100,,,MULTI,WRAP,SCROLL
dialog ADD,TEXT,text1,127,17,,,"Comma sep extensions [Ex. txt,doc,html,etc.]"
dialog ADD,BUTTON,assocClose,155,260,64,24,Close
dialog SHOW
inifile OPEN,%%var24\App\AppInfo\appinfo.ini
%%associations = @iniread(Associations,FileTypes)
dialog set,Associations,%%associations
goto evloop
:assocCloseButton
%%timeroff =
%%newassociations = @dlgtext(associations)
dialog close
repeat
until @not(@event())
if @unequal(%%associations,%%newAssociations)
inifile write,Associations,FileTypes,%%newAssociations
inifile close
gosub refreshlist
gosub refreshtable
end
goto evloop
:disenable
dialog %1,table1
dialog %1,search
if @text(%%favButtons)
%x = 0
repeat
dialog %1,fav%x
%x = @succ(%x)
until @equal(%x,@count(%%favButtons))
dialog %1,all
end
exit
:DocumentsClick
:DocumentsMENU
directory create,@path(%0)Documents
shell open,@path(%0)Documents
goto evloop
:VideosClick
directory create,@path(%0)Videos
shell open,@path(%0)Videos
goto evloop
:MusicClick
:MusicMENU
directory create,@path(%0)Documents\Music
shell open,@path(%0)Documents\Music
goto evloop
:PicturesClick
:PicturesMENU
directory create,@path(%0)Documents\Pictures
shell open,@path(%0)Documents\Pictures
goto evloop
:ExploreClick
:ExploreMENU
shell open,@path(%0)
goto evloop
:Taskbar ButtonMenu
inifile OPEN,@path(%0)%%var15".ini",XML
if %%taskbarButton
inifile WRITE,Settings,taskbarButton
%%taskbarbutton =
window hide,#PL_Dummy
else
inifile WRITE,Settings,taskbarButton,1
%%taskbarbutton = 1
window normal,#PL_Dummy
end
inifile close
goto evloop
:Hide Portable from NameMENU
inifile OPEN,@path(%0)%%var15".ini",XML
if %%hidePort
inifile WRITE,Settings,hidePort
%%hideport =
else
inifile WRITE,Settings,hidePort,1
%%hideport = 1
end
inifile close
gosub refreshList
gosub refreshTable
goto evloop
:Close Apps on ExitMENU
inifile OPEN,@path(%0)%%var15".ini",XML
if %%var16
inifile WRITE,Settings,APCC
%%var16 =
else
inifile WRITE,Settings,APCC,1
%%var16 = 1
end
inifile close
goto evloop
:Install ApplicationMENU
%%instfile = @filedlg(*.paf.exe)
if @ok()
if %%InstFile
run %%InstFile /destination=@substr(%0,1,3)PortableApps\,wait
gosub refreshlist
gosub refreshtable
end
end
goto eventloop
:Explore HereMENU
shell open,%%var24
goto EVENTLOOP
:AutostartMENU
option fieldsep,@tab()
%i = @item(TABLE1)
parse "%%var21;%%var22;%%var23;%%var24;%%var25;%%as;%%ac;%%ex",@item(TABLE1)
option fieldsep,
if %%as
%%as =
else
%%as = X
end
#info %%var21@tab()%%var22@tab()%%var23@tab()%%var24@tab()%%var25@tab()%%as@tab()%%ac@tab()%%ex|%%var24"\"%%var25
#list put,TABLE1,%%var21@tab()%%var22@tab()%%var23@tab()%%var24@tab()%%var25@tab()%%as@tab()%%ac@tab()%%ex|%%var24"\"%%var25
#if @ask("Add to autostart list: "%%var21)
#list ADD,7,%%var25
inifile OPEN,@path(%0)%%var15".ini",XML
inifile write,%%var25,autoStart,%%as
inifile close
#list SAVEFILE,7,@path(%0)startHEREAutoStart.txt
#end
gosub refreshlist
gosub refreshtable
goto EVENTLOOP
:Run selected programMENU
:TABLE1DBLCLICK
dialog CURSOR,WAIT
disenable disable
option FIELDSEP,@tab()
parse "%%var21;%%var22;%%var23;%%var24;%%var25",@item(TABLE1)
option FIELDSEP,|
inifile open,%%var24"\"@name(%%var25)".ini"
inifile write,Settings,DisableSplashScreen,True
inifile close
shell OPEN,%%var24"\"%%var25,,%%var24,
wait "0.5"
disenable enable
dialog CURSOR
if %%searching
%%searching =
dialog show,searchBtn
gosub RefreshList
gosub RefreshTable
dialog clear,search
end
goto EVENTLOOP
:Hide\Show Excluded AppsMENU
if @equal(%%viewExcluded,T)
%%viewexcluded =
else
%%viewexcluded = T
end
gosub RefreshList
gosub RefreshTable
goto evloop
:updateCategory
if @item(TABLE1)
option FIELDSEP,@tab()
parse "%%var21;%%var22;%%var23;%%var24;%%var25;%%as;%%cs;%%ex;%%cat",@item(TABLE1)
%%_index = @index(TABLE1)
#if @ask("Exlude: "%%var21" ["%%var25"]")
inifile OPEN,@path(%0)%%var15".ini",XML
#if %%ex
# inifile write,%%var25,category,
#else
if @equal(%%theCategory,Reset)
inifile delete,%%var25,category
else
inifile write,%%var25,category,%%theCategory
end
#end
inifile close
option FIELDSEP,|
gosub refreshList
gosub refreshTable
if %%_index
if @equal(%%_index,@count(TABLE1))
%%_index = @pred(%%_index)
end
if @greater(%%_index,-1)@less(%%_index,@count(TABLE1))
#scroll selected table item into view
list seek,TABLE1,%%_index
%x = @sendmsg(~TABLE1,$1013,%%_index,0)
#dialog focus,TABLE1
%%_index =
end
end
end
#end
goto EVENTLOOP
:Toggle Excluded AppMENU
:Exclude AppMENU
:BTNEXCLUDEBUTTON
if @item(TABLE1)
option FIELDSEP,@tab()
parse "%%var21;%%var22;%%var23;%%var24;%%var25;%%as;%%cs;%%ex;%%fav",@item(TABLE1)
%%_index = @index(TABLE1)
#if @ask("Exlude: "%%var21" ["%%var25"]")
inifile OPEN,@path(%0)%%var15".ini",XML
if %%ex
inifile write,%%var25,exclude,
#indent TABLE1,@index(TABLE1),0
else
inifile write,%%var25,exclude,X
#if @equal(%%viewExcluded,T)
# indent TABLE1,@index(TABLE1),1
#else
# list DELETE,TABLE1
#end
end
inifile close
#list ADD,6,%%var25
#list SAVEFILE,6,@path(%0)startHEREExclude.txt
#end
option FIELDSEP,|
gosub refreshList
gosub refreshTable
if %%_index
if @equal(%%_index,@count(TABLE1))
%%_index = @pred(%%_index)
end
if @greater(%%_index,-1)@less(%%_index,@count(TABLE1))
#scroll selected table item into view
list seek,TABLE1,%%_index
%x = @sendmsg(~TABLE1,$1013,%%_index,0)
dialog focus,TABLE1
%%_index =
end
end
end
#end
goto EVENTLOOP
:Edit name and descriptionMENU
:BTNEDITBUTTON
option FIELDSEP,@tab()
parse "%%var21;%%var22;%%var23;%%var24;%%var25;%%as;%%cs",@item(TABLE1)
%i = @input(Enter app name:,%%var21)
if @not(@ok())
goto evloop
end
if @not(%i)
goto evloop
end
inifile OPEN,@path(%0)%%var15".ini",XML
inifile write,%%var25,Name,%i
inifile close
option fieldsep,
list put,TABLE1,%i@tab()%%var22@tab()%%var23@tab()%%var24@tab()%%var25@tab()%%as@tab()%%cs|%%var24"\"%%var25
goto EVENTLOOP
:Refresh listMENU
:BTNREFRESHBUTTON
gosub REFRESHLIST
gosub REFRESHTABLE
goto EVENTLOOP
:BTNRUNBUTTON
if @item(TABLE1)
if @greater(@selected(TABLE1),1)
list ASSIGN,2,@items(TABLE1)
list SEEK,2,0
option FIELDSEP,@tab()
repeat
parse "%%var21;%%var22;%%var23;%%var24;%%var25",@item(2)
shell OPEN,%%var24"\"%%var25
%%var26 = @next(2)
until @null(@item(2))
option FIELDSEP,|
else
option FIELDSEP,@tab()
parse "%%var21;%%var22;%%var23;%%var24;%%var25",@item(TABLE1)
shell OPEN,%%var24"\"%%var25
option FIELDSEP,|
end
end
goto EVENTLOOP
:Settings/OptionsMENU
gosub CONFIGBOX
goto EVENTLOOP
:Help!MENU
:BTNHELPBUTTON
info "Help?! You need Help!?"@cr()@cr()"Well I haven't made any help file or anything yet, so you'll just have to figure it out or email me. :-)"
goto EVENTLOOP
:startHERE informationMENU
:BTNINFOBUTTON
shell OPEN,%0,/A
goto EVENTLOOP
:BTNEXITBUTTON
goto CLOSE
:xml
#%t = @xml(< XMLID >,< key >,< subkey > [optional])
%%exit = @strslice(@text(%1),<%2>,)
if %3
%%exit = @strslice(%%exit,<%3>,)
end
exit %%exit
:REFRESHLIST
list CLEAR,3
list CLEAR,4
list CLEAR,5
list CLEAR,6
list CLEAR,7
#list LOADFILE,6,@path(%0)%%var15".ini"
#list LOADFILE,7,@path(%0)startHEREAutoStart.txt
#inifile open,@path(%0)startHEREND.txt,XML
list FILELIST,3,@path(%0)\PortableApps,D
#list ADD,3,@path(%0)
%%var27 = @curdir()
if @greater(@count(3),0)
list SEEK,3,0
repeat
%%var28 = @item(3)
directory CHANGE,%%var28"\"
list CLEAR,4
list FILELIST,4,*.EXE
if @greater(@count(4),0)
list SEEK,4,0
repeat
inifile OPEN,@path(%0)%%var15".ini",XML
%%name = @iniread(@item(4),Name)
%%autostart = @iniread(@item(4),autoStart)
%%exclude = @iniread(@item(4),Exclude)
%%cat = @iniread(@item(4),Category)
inifile close
inifile open,@curdir()\App\AppInfo\appinfo.ini
%c = @iniread(Version,DisplayVersion)
%b = @iniread(Details,Description)
%%assoc = @strrep(@iniread(Associations,FileTypes),",",".",ALL)
if @not(%%cat)
%%cat = @iniread(Details,Category)
end
inifile close
if @unequal(@curdir()\@item(4),%0)
if %%name
%a = %%name
else
#%a = @verinfo(@curdir()\@item(4),P)
%a = @name(@item(4))
end
#dialog set,table1,%a...
if @null(%A)
%a = @name(@item(4))
end
if %%hidePort
%a = @strrep(%a,portable,,)
end
#%b = @verinfo(@curdir()\@item(4),D)
#%c = @verinfo(@curdir()\@item(4),V)
#set T in list of app is set to auto start
if %%autoStart
list add,7,@item(4)
end
if %%exclude
if @equal(%%viewExcluded,T)
option FIELDSEP,|
list ADD,5,%A@tab()%C@tab()%B@tab()@curdir()@tab()@item(4)@tab()%%autoStart@tab()%%cs@tab()X@tab()%%cat@tab()%%assoc
end
else
option FIELDSEP,|
list ADD,5,%A@tab()%C@tab()%B@tab()@curdir()@tab()@item(4)@tab()%%autoStart@tab()%%cs@tab()@tab()%%cat@tab()%%assoc
end
end
%%name =
%%autostart =
%%exclude =
%%cat =
%%assoc =
%%var26 = @next(4)
until @null(@item(4))
end
%%var26 = @next(3)
until @greater(@succ(@index(3)),@count(3))
end
list SORT,5
directory CHANGE,%%var27
inifile close
exit
:getCategory
if @not(%1)
%1 = Other
end
#for backward compat
if @numeric(%1)
exit %1
end
###
list seek,%%category,0
%m = @match(%%category,%1)
if @not(%m)
list seek,%%category,0
%m = @match(%%category,Other)
%%exit = @index(%%category)
else
%%exit = @index(%%category)
end
exit %%exit
:REFRESHTABLE
if @text(5)
list CLEAR,TABLE1
dialog hide,table1
list SEEK,5,0
%f = 0
list clear,%%favButtons
%z = 0
repeat
option FIELDSEP,@tab()
parse "%%var21;%%var22;%%var23;%D;%%var25;%%aS;%%cS;%%vE;%%cat",@item(5)
option FIELDSEP,|
if @file(%%var24"\"@name(%%var25)".ico")
list ADD,TABLE1,@item(5)|%D"\"@name(%%var25)".ico"
else
list ADD,TABLE1,@item(5)|%D"\"%%var25
end
if %%cat
# TGROUP MOVEITEMTOGROUP,< Table >,< GroupID >,< Table Index >
tgroup MOVEITEMTOGROUP,TABLE1,@getCategory(%%cat),%z
if @equal(%%cat,Favorites)
if @less(%f,12)
dialog set,fav%f,%%var21
dialog show,fav%f
%f = @succ(%f)
%%favexist = T
list add,%%favButtons,%D\%%var25
end
end
else
tgroup MOVEITEMTOGROUP,TABLE1,@getCategory(),%z
end
%z = @succ(%z)
if @equal(%%vE,X)
indent TABLE1,@pred(@count(table1)),1
end
%%ve =
%%fav =
%%var26 = @next(5)
until @null(@item(5))
gosub favButtons
end
exit
:favButtons
if @text(%%favButtons)
dialog hide,table1
dialog show,all
dialog hide,search
dialog hide,searchBanner
else
dialog show,table1
dialog hide,all
dialog hide,favs
dialog show,search
dialog show,searchBanner
dialog setpos,TABLE1,28,2,250,440
end
exit
:ABOUTBOX
if @winexists(#PL_MainABOUT)
window NORMAL,#PL_MainABOUT
window ACTIVATE,#PL_MainABOUT
window ONTOP,#PL_MainABOUT
exit
end
dialog CREATE,About %%var0,-1,0,328,206,ONTOP,NOMIN,CLASS PL_MainABOUT
dialog ADD,STYLE,ABSTYLE4,Tahoma,8,C,,
dialog ADD,STYLE,ABSTYLE3,Tahoma,10,C,,
dialog ADD,STYLE,ABSTYLE2,Tahoma,12,BC,,
dialog ADD,STYLE,ABSTYLE1,Tahoma,16,BC,SILVER,BLACK
dialog ADD,BITMAP,ABBITMAP1,10,148,32,32,%0
dialog ADD,TEXT,ABTEXT1,50,0,328,24,%%var0,,ABSTYLE1,TRANSPARENT
dialog ADD,TEXT,ABTEXT2,80,0,328,20,"Version "%%var3,,ABSTYLE2,TRANSPARENT
dialog ADD,TEXT,ABTEXT3,110,0,328,18,%%var7,,ABSTYLE3,TRANSPARENT
dialog ADD,TEXT,ABTEXT4,130,0,328,14,"Copyright "%%var14 %%var8", All rights reserved",,ABSTYLE4
dialog ADD,BUTTON,ABBUTTON1,166,10,80,30,More >>,,ABSTYLE3
dialog ADD,BUTTON,ABBUTTON2,166,238,80,30,Close,,ABSTYLE3
dialog ADD,LINE,ABGRILLE0,166,100,130,2
dialog ADD,LINE,ABGRILLE1,171,100,130,2
dialog ADD,LINE,ABGRILLE2,176,100,130,2
dialog ADD,LINE,ABGRILLE3,181,100,130,2
dialog ADD,LINE,ABGRILLE4,186,100,130,2
dialog ADD,LINE,ABGRILLE5,191,100,130,2
dialog ADD,LINE,ABGRILLE6,196,100,130,2
dialog ADD,TAB,ABTAB1,216,10,308,178,Specifics|Credits|Miscellaneous|License,,ABSTYLE3
dialog ADD,EDIT,ABEDIT1,250,22,284,132,,,ABSTYLE4,MULTI,SCROLL,READONLY,WRAP
%%var29 = "Title:"@tab()@tab()%%var0@cr()"Version: "@tab()%%var3@cr()"Released:"@tab()%%var4@cr()"Author: "@tab()%%var8@cr()@cr()%%var13@cr()%%var12@cr()@cr()"License:"@tab()@tab()%%var9@cr()"Price: "@tab()@tab()%%var10@cr()"User: "@tab()@tab()%%var11@cr()@cr()"Copyright "%%var14 %%var8", All rights"@cr()"reserved."
%%var30 = Gui Programming:@tab()%%var8@cr()Core Programming:@tab()%%var8@cr()@cr()Icons courtesy of Tal Sella (Aka: Scrow)@cr()
http://www.virtualplastic.net/scrow/
%%var31 = "Based on Port'Launch from Garrett R. Hylltun"
%%var32 = " This software is provided as-is."@cr()" There are no warranties, expressed or implied."@cr()@cr()"CHRIS GINGERICH DISCLAIMS ALL"@cr()"WARRANTIES RELATING TO THIS SOFTWARE,"@cr()
%%var32 = %%var32"WHETHER EXPRESS OR IMPLIED, INCLUDING "@cr()"BUT NOT LIMITED TO ANY IMPLIED"@cr()"WARRANTIES OF MERCHANTABLITY AND"@cr()"FITNESS FOR A PARTICULAR PURPOSE, AND "@cr()
%%var32 = %%var32"ALL SUCH WARRANTIES ARE EXPRESSLY "@cr()"AND SPECIFICALLY DISCLAIMED. NEITHER "@cr()"CHRIS GINGERICH NOR ANYONE ELSE "@cr()"WHO HAS BEEN INVOLVED IN THE CREATION, "@cr()
%%var32 = %%var32"PRODUCTION , OR DELIVERY OF THIS "@cr()"SOFTWARE SHALL BE LIABLE FOR ANY"@cr()"INDIRECT, CONSEQUENTIAL, OR INCIDENTAL"@cr()"DAMAGES ARISING OUT OF THE USE OR "@cr()
%%var32 = %%var32"INABILITY TO USE SUCH SOFTWARE EVEN IF "@cr()"CHRIS GINGERICH HAS BEEN ADVISED OF "@cr()"THE POSSIBILITY OF SUCH DAMAGES OR "@cr()"CLAIMS. IN NO EVENT SHALL CHRIS "@cr()
%%var32 = %%var32"GINGERICH LIABILITY FOR ANY DAMAGES EVER "@cr()"EXCEED THE PRICE PAID FOR THE LICENSE "@cr()"TO USE THE SOFTWARE, REGARDLESS OF"@cr()"THE FORM OF CLAIM. THE PERSON USING "@cr()
%%var32 = %%var32"THE SOFTWARE BEARS ALL RISK AS TO THE "@cr()"QUALITY AND PERFORMANCE OF THE "@cr()"SOFTWARE."@cr()@cr()@cr()" Some states do not allow the exclusion of the limit of liability for consequential "
%%var32 = %%var32"or incidental damages, so the above limitation may not apply to you."@cr()@cr()" This agreement shall be governed by the laws of the State of Washington and shall inure to the benefit of Chris Gingerich and any "
%%var32 = %%var32"successors, administrators, heirs and assigns. Any action or proceeding brought by either party against the other arising out of or related to this agreement shall be brought only in a STATE or FEDERAL COURT of "
%%var32 = %%var32"competent jurisdiction located in Pierce County, Washington. The parties hereby consent to in personam jurisdiction of said courts."@cr()@cr()" This software and the disks on which it may be contained on, is licensed "
%%var32 = %%var32"to you for your own use. This is copyrighted software. You are not btaining title to the software or any copyrights. You may not sublicense, rent, lease, convey, modify, translate, convert to another programming "
%%var32 = %%var32"language, decompile, or disassemble the software for any purpose."@cr()@cr()" Support is available on a limited means and is limited to electronic online forms of conveyance only. Author reserves the right to revoke "
%%var32 = %%var32"all support of this program at any time without notice."@cr()@cr()" Program is subject to change without notice and may be discontinued at the author’s discretion without notice."@cr()@cr() "You may make copies of "
%%var32 = %%var32"this program; install this program on as many computers as you wish. You may make backups of this program on as many disks as you see fit."@cr()@cr()" You may distribute this program either online or in the form "
%%var32 = %%var32"of a Disk or CD. YOU MAY NOT SELL THIS PROGRAM at all in souce or binary format. You may not charge for profit online, on disk or on CD for the distribution."@cr()
list CREATE,1
list ASSIGN,1,%%var29
dialog SHOW
dialog SET,ABEDIT1,@text(1)
%a = 1
:ABOUTLOOP
wait EVENT
%e = @event()
if @equal(%E,CLOSE)
goto ABOUTCLOSE
else
goto %E
end
exit
:ABBUTTON2BUTTON
:ABOUTCLOSE
exit
:ABBUTTON1BUTTON
if %A
window POSITION,#PL_MainABOUT,@fsub(@winpos(#PL_MainABOUT,T),100),@winpos(#PL_MainABOUT,L),@winpos(#PL_MainABOUT,W),@sum(@winpos(#PL_MainABOUT,H),200)
dialog SET,ABBUTTON1,Less <<
%a =
else
window POSITION,#PL_MainABOUT,@sum(@winpos(#PL_MainABOUT,T),100),@winpos(#PL_MainABOUT,L),@winpos(#PL_MainABOUT,W),@fsub(@winpos(#PL_MainABOUT,H),200)
dialog SET,ABBUTTON1,More >>
%a = 1
end
goto ABOUTLOOP
:SpecificsCLICK
list ASSIGN,1,%%var29
dialog SET,ABEDIT1,@text(1)
goto ABOUTLOOP
:CreditsCLICK
list ASSIGN,1,%%var30
dialog SET,ABEDIT1,@text(1)
goto ABOUTLOOP
:MiscellaneousCLICK
list ASSIGN,1,%%var31
dialog SET,ABEDIT1,@text(1)
goto ABOUTLOOP
:LicenseCLICK
list ASSIGN,1,%%var32
dialog SET,ABEDIT1,@text(1)
goto ABOUTLOOP
:TaskExists
#windows XP Pro and above
if @not(%1)
error 2
end
runh tasklist /svc /FI @chr(34)imagename eq %1@chr(34),pipe
%l = @pipe()
if @greater(@pos(%1,%l),0)
%e = T
end
exit %e
#/code#
:wallpaper
#if WallpaperChanger.exe not found, exit
if @equal(%%wallpaperChanger,F)
exit
end
if @equal(%1,Start)
if @file(%%wallpaper)
#get current wallpaper
%%wp_set = @regread(CURUSER,Control Panel\Desktop,Wallpaper)
#set new wallpaper
runh @path(%0)WallpaperChanger.exe @chr(34)%%wallpaper@chr(34)
else
%%wp_set =
end
elsif @equal(%1,end)
if %%wp_set
#restore previous wallpaper
runh @path(%0)WallpaperChanger.exe @chr(34)%%wp_set@chr(34)
%%wp_set =
end
end
exit
:indent
#indent < Table >,< iIndex >,< Indent Size >
%l = @binary(DWORD,$10)@binary(DWORD,%2)@binary(DWORD,0)@binary(DWORD,0)@binary(DWORD,0)@binary(DWORD,0)@binary(DWORD,0)@binary(DWORD,0)@binary(DWORD,0)@binary(DWORD,%3)
%x = @SENDMSG(@WINEXISTS(~%1),4102,0,%L)
exit
# tGroup.dsc part of the extTable.dsu #
# Author: Michael (Aslan) Andersen #
# 19 December 2007 #
:tGroup
goto %1
#***************************commands*********************************#
:ENABLEGROUPVIEW
# Usage TGROUP ENABLEGROUPVIEW,< Table >
%x = @SENDMSG(@WINEXISTS(~%2),4253,1,0)
goto cleanup
:DISABLEGROUPVIEW
# Usage TGROUP DISABLEGROUPVIEW,< Table >
%x = @SENDMSG(@WINEXISTS(~%2),4253,0,0)
goto cleanup
:INSERTGROUP
# Usage TGROUP INSERTGROUP,< Table >,< GroupID >,< Table Index >,< HeaderTx >,< uAlign >
# Note: < uAlign > options are RIGHT, LEFT(Default), or CENTER
%c = @len(%5)
%t = @mkwideCharStr(%5)
if %6
if @equal(%6,CENTER)
%a = $2
end
if @equal(%6,LEFT)
%a = $1
end
if @equal(%6,RIGHT)
%a = $4
end
else
%a = $1
end
%l = @BINARY(DWORD,40)@BINARY(DWORD,@SUM($1,$8,$10))@BINARY(DWORD,@addr("%T"))@BINARY(DWORD,%C)@BINARY(DWORD,0)@BINARY(DWORD,0)@BINARY(DWORD,%3)@BINARY(DWORD,0)@BINARY(DWORD,0)@BINARY(DWORD,%A)
%x = @SENDMSG(@WINEXISTS(~%2),4241,%4,%L)
goto cleanup
:MOVEITEMTOGROUP
# Usage TGROUP MOVEITEMTOGROUP,< Table >,< GroupID >,< tIndex >
%l = @binary(DWORD,$100)@binary(DWORD,%4)@binary(DWORD,0)@binary(DWORD,0)@binary(DWORD,0)@binary(DWORD,0)@binary(DWORD,0)@binary(DWORD,0)@binary(DWORD,0)@binary(DWORD,0)@binary(DWORD,%3)
%x = @SENDMSG(@WINEXISTS(~%2),4102,0,%L)
goto cleanup
:MOVEGROUP
# Usage TGROUP MOVEGROUP,< Table >,< current gIndex >,< new gIndex >
%x = @SENDMSG(@WINEXISTS(~%2),4247,%3,%4)
goto cleanup
:REMOVEGROUP
#usage TGROUP REMOVEGROUP,< Table >,< GroupID >
%x = @SENDMSG(@WINEXISTS(~%2),4246,%3,0)
goto cleanup
:REMOVEALLGROUPS
#usage TGROUP REMOVEALLGROUPS,< Table >
%x = @SENDMSG(@WINEXISTS(~%2),4256,0,0)
goto cleanup
:SETGROUPMETRICS
#usage TGROUP SETGROUPMETRICS,< Table >,< option >,< value >
#note: < option > can be BORDERCOLOR,BORDERSIZE, or TEXTCOLOR
%%table = %2
if @equal(%3,BORDERCOLOR)
%m = $2
%%crleft = @RGB2DEC(%4)
%%crtop = @RGB2DEC(%5)
%%crright = @RGB2DEC(%6)
%%crbottom = @RGB2DEC(%7)
elsif @equal(%3,BORDERSIZE)
%m = $1
%%left = %4
%%top = %5
%%right = %6
%%bottom = %7
elsif @equal(%3,TEXTCOLOR)
%m = $4
%%crheader = @RGB2DEC(%4)
else
error 4
end
%l = @BINARY(DWORD,48)@BINARY(DWORD,%M)@BINARY(DWORD,%%Left)@BINARY(DWORD,%%Top)@BINARY(DWORD,%%Right)@BINARY(DWORD,%%Bottom)@BINARY(DWORD,%%crLeft)@BINARY(DWORD,%%crTop)@BINARY(DWORD,%%crRight)@BINARY(DWORD,%%crBottom)@BINARY(DWORD,%%crHeader)@BINARY(DWORD,0)
%x = @SENDMSG(@WINEXISTS(~%%table),@SUM($1000,155),0,@addr("%L"))
goto cleanup
#**************************functions*********************************#
:mkWideCharStr
loadlib kernel32.dll
%w = @fill(@prod(@sum(@len(%1),1),2))
%x = @lib(kernel32,MultiByteToWideChar,INT:,0,0,STR:%1,-1,@addr("%W"),@prod(@sum(@len(%1),1),2))
freelib kernel32
exit %W
:RGB2DEC
%2 = @RGB2HEX(%1)
%3 = @SSHEX2DEC(%2)
exit %3
:RGB2HEX
if %2
%h = @hex(%1,2)@hex(%2,2)@hex(%3,2)
else
%%fsep = @Fsep()
%f = @pos(|,%1)
if @greater(%F,0)
option fieldsep,"|"
else
option fieldsep,@chr(32)
end
parse "%B;%G;%R",%1
option fieldsep,%%Fsep
%h = @hex(%R,2)@hex(%G,2)@hex(%B,2)
end
%1 =
%2 =
%3 =
%r =
%g =
%b =
exit %H
:SSHex2Dec
%%ssh2dhex = %1
%%ssh2d = 0
%%ssh2dx = 1
repeat
%%ssh2dchar = @UPPER(@SUBSTR(%%SSH2DHex,%%SSH2DX,%%SSH2DX))
%%ssh2dpos = @FSUB(@POS(%%SSH2DChar,"0123456789ABCDEF"),1)
%%ssh2d = @FADD(@FMUL(%%SSH2D,16),%%SSH2DPos)
%%ssh2dx = @SUCC(%%SSH2DX)
until @GREATER(%%SSH2DX,@LEN(%%SSH2DHex))
exit %%SSH2D
:GETGROUPMETRICS
#usage @TGROUP(GETGROUPMETRICS,< table >)
%l = @BINARY(DWORD,48)@BINARY(DWORD,@sum($2,$1,$4))@fill(40,,Z)
%x = @SENDMSG(@WINEXISTS(~%2),@SUM($1000,156),0,@addr("%L"))
%%result = @val(@substr(%L,9,12))|@val(@substr(%L,13,16))|@val(@substr(%L,17,20))|@val(@substr(%L,21,24))|@val(@substr(%L,25,28))|@val(@substr(%L,29,32))|@val(@substr(%L,33,36))|@val(@substr(%L,37,40))|@val(@substr(%L,41,44))|@val(@substr(%L,45,48))
gosub cleanup
exit %%Result
:HASGROUP
#usage @TGROUP(HASGROUP,< Table >,< GroupID >)
%x = @SENDMSG(@WINEXISTS(~%2),4257,%3,0)
exit %X
:CleanUp
%1 =
%2 =
%3 =
%4 =
%5 =
%6 =
%7 =
%8 =
%9 =
%m = 0
%h = 0
%a = 0
%s = 0
%i = 0
%l = 0
%c = 0
%x =
%%crheader = 0
%%left = 0
%%top = 0
%%right = 0
%%bottom = 0
%%crleft = 0
%%crtop = 0
%%crright = 0
%%crbottom = 0
exit
#lvgroup ********************************************************************************************************
# Members:
# bSize = 40
#mask = Specifies which members of the structure are valid input. It can have one or more of the following values.
#lvgf_align = $8
#lvgf_groupid = $10
#lvgf_header = $1
#lvgf_none = $0
#lvgf_state = $4
#pszheader = Pointer to a string that contains the header.
#cchheader = Number of characters in the string that specifies the header.
#pszfooter = Pointer to a string that contains the footer.
#cchfooter = Number of characters in the string that specifies the footer.
#igroupid = Identifier (ID) of the group.
#statemask = 0
#state
#lvgs_collapsed = $1
#lvgs_hidden = $2
#lvgs_normal = $0
#ualign = Indicates the alignment of the header or footer text for the group. It can have one or more of the following values. Use one of the header flags. Footer flags are optional. Windows XP: Footer flags are reserved.
#lvga_header_center = $2
#lvga_header_left = $1
#lvga_header_right = $4
#lvgroupmetrics *************************************************************************************************
#members:
#cbsize = 48
#mask = Flag that can have one or more of the following values.
#lvgmf_bordercolor = $2
#lvgmf_bordersize = $1
#lvgmf_none = $0
#lvgmf_textcolor = $4
#left = Specifies the left border.
#top = Specifies the top border.
#right = Specifies the right border.
#bottom = Specifies the bottom border.
#crleft = Specifies the color of the left border.
#crtop = Specifies the color of the top border.
#crright = Specifies the color of the right border.
#crbottom = Specifies the color of the bottom border.
#crheader = Specifies the color of the header text.
#crfooter = Specifies the color of the footer text.
#:lvgroupmetrics
# %L = @BINARY(DWORD,48)@BINARY(DWORD,%M)@BINARY(DWORD,%%Left)@BINARY(DWORD,%%Top)@BINARY(DWORD,%%Right)@BINARY(DWORD,%%Bottom)@BINARY(DWORD,%%crLeft)@BINARY(DWORD,%%crTop)@BINARY(DWORD,%%crRight)@BINARY(DWORD,%%crBottom)@BINARY(DWORD,%%crHeader)@BINARY(DWORD,0)
# Exit
#****************************************************************************************************************
#lvinsertgroupsorted*********************************************************************************************
#members:
#%%pfngroupcompare = Pointer to application-defined function LVGroupCompare that is used to sort the groups.
#%%pvdata = Data to sort; this is application-defined.
#%%lvgroup = Group to sort; this is application-defined.
#%%lvinsertgroupsorted = @BINARY(DWORD,%%pfnGroupCompare)@BINARY(DWORD,%%pvData)@BINARY(DWORD,%%lvGroup)
#****************************************************************************************************************
#lvgroupcompare *************************************************************************************************
#%%group1_id = [in] ID of the first group.
#%%group2_id = [in] ID of the second group.
#%%pvdata = [in] Pointer to the application-defined information. This comes from the message that was called; for %%LVM_INSERTGROUPSORTED it is LVINSERTGROUPSORTED.pvData, and for %%LVM_SORTGROUPS it is the plv parameter.
# %%LVGROUPCOMPARE = @BINARY(DWORD,%%Group1_ID)@BINARY(DWORD,%%Group2_ID)@BINARY(DWORD,%%pvData)
#****************************************************************************************************************