Source CodeA great big “Thank You!” to everyone who donated to the release of the source code for DCoT Menu. Because of your generosity, DCoT Menu is now available to everyone as open source code. Feel free to download the code and start making your own derivative branches of this application.

Here are the generous people who we all have to thank for this:

So, here is what you have all been waiting for, the DCoT Menu source code:

#Include <Constants.au3>
#NoTrayIcon
 
Dim $DriveLetter = StringLeft(@ScriptDir,2)
Dim $ConfigFile = @ScriptDir & "\DCoTMenu.ini"
Dim $AppListFile = @ScriptDir & "\" & IniRead($ConfigFile,"General","AppListFile","AppList.ini")
Dim $AppList
Dim $MenuItem[1]
Dim $AppExecutable[1]
Dim $AppCounter
Dim $ApplicationName
Dim $Executable
Dim $WorkingDirectory
Dim $Author
Dim $Website
Dim $BrowseDrive
Dim $CreditsItem
Dim $DCoTWebsite
Dim $AppsInMenu = 0
Dim $Credits = "DCoT Menu by Daily Cup of Tech" & @CRLF & "Website: http://www.DailyCupOfTech.com"
Dim $DisplaySystemCredit = IniRead($ConfigFile,"General","DisplaySystemCredit","")
Dim $SystemCredit = IniRead($ConfigFile,"General","SystemCredit","")
Dim $DisplayBrowse = IniRead($ConfigFile,"General","DisplayBrowse","")
Dim $DisplayCredit = IniRead($ConfigFile,"General","DisplayCredits","")
 
 
If $DisplaySystemCredit = "True" Then
	$Credits &= @CRLF & @CRLF & "USB Drive System Concept by " & $SystemCredit
EndIf
 
Opt("TrayMenuMode",1)
 
$AppList = IniReadSectionNames($AppListFile)
 
If @error Then
	MsgBox (0,"No Apps","No apps available")
	Exit
EndIf
 
ReDim $MenuItem[$AppList[0]+1]
ReDim $AppExecutable[$AppList[0]+1]
 
For $AppCounter = 1 To $AppList[0]
	$ApplicationName = $AppList[$AppCounter]
	$Executable = @ScriptDir & IniRead($AppListFile,$ApplicationName,"Executable","")
	$Author = IniRead($AppListFile,$ApplicationName,"Author","")
	$Website = IniRead($AppListFile,$ApplicationName,"Website","")

	If FileExists($Executable) Then
		$MenuItem[$AppCounter] = TrayCreateItem($ApplicationName)
		$AppExecutable[$AppCounter] = $Executable
		$Credits &= @CRLF & @CRLF & $ApplicationName

		If $Author <> "" Then
			$Credits &= " by " & $Author
		EndIf

		If $Website <> "" Then
			$Credits &= @CRLF & "Website: " & $Website
		EndIf

		$AppsInMenu += 1
	EndIf
Next
 
If $AppsInMenu = 0 Then
	MsgBox (0,"No Apps","No apps available")
	Exit
EndIf
 
TrayCreateItem("")
 
If $DisplayBrowse = "True" Then
	$BrowseDrive = TrayCreateItem("Browse USB Drive")
EndIf
 
If $DisplayCredit = "True" Then
	$CreditsItem = TrayCreateItem("Credits")
EndIf
 
$DCoTWebsite = TrayCreateItem("Daily Cup of Tech")
TrayCreateItem("")
$ExitItem = TrayCreateItem("Exit")
 
TraySetState()
TraySetToolTip("Click to show menu")
TrayTip("DCoT Menu","Access your USB applications by clicking this icon at any time.",5,1)
 
While 1
    $TrayMessage = TrayGetMsg()
	For $AppCounter = 1 To $AppList[0]
		If $TrayMessage = $MenuItem[$AppCounter] Then
			$Executable = $AppExecutable[$AppCounter]
			$WorkingDirectory = StringLeft($Executable,StringInStr($Executable,"\",0,-1))
			Run($Executable,$WorkingDirectory)
		EndIf
	Next

    Switch $TrayMessage
		Case 0

			If Not FileExists(@ScriptFullPath) Then
				ExitLoop
			Else
				ContinueLoop
			EndIf
 
        Case $ExitItem
            ExitLoop

		Case $BrowseDrive
			Run("explorer.exe " & $DriveLetter)

		Case $DCoTWebsite
			Local $Url = "http://www.DailyCupOfTech.com"
			Run(@ComSpec & " /c Start " & $Url, "", @SW_HIDE)

		Case $CreditsItem
			MsgBox(64,"Credits",$Credits)

    EndSwitch
WEnd

Download this code: DCoTMenu.au3

Similar Posts:

If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?