DCoT Menu Now Open Source
A 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:
- AlwaysWebHosting.com (twice!)
- Barry H.
- Brian C.
- Eric John W.
- Mark H.
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
If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?
8 Responses to “DCoT Menu Now Open Source”
-
Brian Says:
May 2nd, 2007 at 9:03 amAh now I can see what is behind this great utility!
Thanks for releasing the code for this. As I am just beginning with AutoIT it is great to see these excellent working examples. I think I will be seeing what I can come up with over the next couple of days with this.
Keep up the good work
brian
-
JC Says:
May 2nd, 2007 at 10:49 amHi Tim,
Overall, good quality code…
Still think the price per code line is a bit expensive as it is roughly 1 USD/per line (there is 103 lines in your script, excluding blank lines) : not even the most skilled programming consultant in the World charges this much : but I already complained about the price of your sources so I won’t get back to this topic.Just a quick comment though on that line though :
Run(@ComSpec & ” /c Start ” & $Url, “”, @SW_HIDE)I thought it was a bit dirty to invoke the command interpreter (even if its window it is hidden) just to benefit of its start command to be able to launch the website using the default browser, so I’ve looked up in the AutoIT documentation to check if there wasn’t a better way.
Indeed, I was surprised to see that there was no better way to do this on the stable version… however, the latest betas sports a new ShellExecute function which launches of URL or whatever file with its default program : http://www.autoitscript.com/autoit3/docs/functions/ShellExecute.htm
There is also ShellExecuteWait on the same spirit but to wait or the termination of the launched item…That said, be aware that their implementation is somewhat broken since they say that “open” is the default verb while it is not… (it can be “view”, or anything else) : see http://blogs.msdn.com/oldnewthing/archive/2007/04/30/2332224.aspx for more details.
Since this function is only to be seen in beta versions so far, it is up to you to decide to reflect this change as it is IMHO a better method, but might cause problems for some users using the older/stable AutoIT version…
That said, I’ve been very surprised when writing this comment to see that one advertisement from your blog suddenly became really large and actually tried to install an ActiveX on me for a software called ErrorSafe…
It looks like the usual fake adware scanning again making the users believe they are infected…
I rebuild my computer frequently (last time yesterday night) from an unattended install so it is clean and use fully updated antispyware and antivirus (NOD32) software, behind a secure firewall, and fully patched Windows and IE, and didn’t surf the web today until I’ve read your blog and it runs inside a sandbox anyway…As I said I already voiced my opinion about your recent trend in trying to make as much money as you can from your website, and I won’t get back to this topic in great lenghts, but you may want to review and make sure with the advertisments company involved on your blog that they do not show up malware ads anymore…
(I can’t believe it is from Google, but maybe from FeedBurner or any other you have…)Please see this picture for more details : http://cps00.online.fr/dcot.gif
And please see this URL for more information : http://www.mikeonads.com/what-is-errorsafe-and-how-do-we-stop-it/
I can bear the constants calls for money (tip jar, added ads, and posts reminding people they can to pay for the source code) are already annoying me a bit, but if it makes your website insecure to people, I don’t think it is actually supporting anyone, including yourself…
-
Open Source Corner | Everything and Anything Open Source Says:
May 2nd, 2007 at 10:59 amDCoT Menu Now Open Source Posted by opensourcecorner.com on May 2nd, 2007 Login or register to post comments Read original article.
-
JC Says:
May 2nd, 2007 at 11:18 amJust a little follow up… as I belive from the location the spyware ad appeared that it could be from Robert Sherman networks…
If you go to www.hermoment.com, you get to a really strange webpage…
I might be wrong.
Also looking up “Robert Sherman” advertising on Google didn’t return many results and I couldn’t easily find their homepage…It doesn’t look like a really legitimate ad company to me and may be the source from that adware window…
I hope you will be able to give some feedback on this soon…
Thanks,
JC.
-
JC Says:
May 2nd, 2007 at 11:37 amSorry, me again : Some html code I pasted to explain my point got deleted in my comment by the commenting system, so it doesn’t make much sense without it, but if you look at the source code of this very webpage using the view source function of the browser, you will see that the ad script of Sherman network is actually stored on the hermoment.com domain…
Hope this helps,
-
Curious Says:
May 2nd, 2007 at 1:01 pmAnyone who does make an improved version, please make a link available so the rest of us can enjoy it too!
Thx
-
Tim Fehlman Says:
May 2nd, 2007 at 1:07 pmJC,
First, thanks for the compliment on the code. I really put a lot of time and effort into it and I appreciate your honest feedback on the structure. I am note a code by trade and it is good to see that I am on the right track when it comes to writing my own code.
Second, yes, AutoIt has its limitation and I appreciate you checking whether or not there is a better way to do something. Since coding is only a hobby, chances are pretty slim that I would have the time to learn a “real” programming language. I am generally interested in creating code as quickly as possible so that I can get on to other things and AutoIt enables me to do just that.
Third, thank you so much for the heads up on the whole Robert Sherman advertising issue. I was completely unaware that they had anything like that in their network. I have e-mailed them with a complain about their practices and removed their code from DCoT. There are some advertising techniques that really drive me nuts and pop-up ads are one of them. Others include pop-unders and interstitial ads. I simply refuse to put any of these on my site.
Tim
-
JC Says:
May 2nd, 2007 at 5:49 pmThanks for the quick feedback on the issue and the clear policy about which kinds of advertising we will see from now on.
I have not much problems with your ads since they are mostly unintrusive indeed and do not indeed browsing that much… (actually, some could even remove them using browser plugins, that you probably know about but that I won’t talk about here to not drive away revenue from your blog as removing ads would mean people wouldn’t click them.I’m glad to have helped you this way because I won’t probably help you financially.
While this source is as I said at a rather good level, I have no motivation or need in getting them myself.
I also won’t be giving anything on the tip jar since I don’t have a paypal account and won’t give away my credit card number “just” for a single donation.You said in a previous comment that you’re against that “take but never give back attitude” on the internet… and I’m against it as well and prefer to contribute by leaving comments that I may find useful and giving money is not the only way to give back to the community in my opinion.
Still, I am glad to have contributed in some way and just wanted to explain this as I sometimes nag about these money-things on your blog.In your reply you say that “you would have the time to learn a “real” programming language”.
Actually, you could be surprised of how many prerequisites the code you posted show for raw Win32 programming (directly with API calls).The way AutoIT handles its window is very similar to the message loop in the traditional Windows C applications and already knowing what a window message is about and how to process a message loop is already a big advantage.
Actually, handling windows with so called “event-driven” window processing like in Visual Basic looks way simpler than handling window messages to the beginner, but it also gets a lot more confusing when you try to get serious and use really languages near to the processor and the operating system like how you can program in C under Windows.A benefit of this would be executables of a few kilobytes (the program you wrote would be roughly 6 kilo-bytes, opposed to some hundred kilo-bytes for the AutoIT version.
I am not saying that you should give up AutoIT, but just that it doesn’t limit you to this and that you already have the background to do some Win32API programming thanks to your work on this tool.
A good resource to start is WinProg : http://www.winprog.org/To reply to the commenter “Curious”, if you were talking to me when you posted this, regarding the alternative ShellExecute function, I could post the amended version somewhere (but I don’t have access to posting articles on this blog, so it is up to Tim to decide if he wants to post an amended version on DCoT, but I think it would be a lot better for you to try to experiment and replace that source code line yourself.
You now have the source and documentation and you can try this yourself.
Experimenting on existing sources is a great way to learn and I don’t feel it would help much if I posted the amended version.
Tim’s code base is an excellent way to start and great resource for people wanting to learn AutoIT and people now need to get their hands dirty and fiddle with this code by themselves to get some training benefits. -
Raymond Says:
May 3rd, 2007 at 3:39 amIndeed, looking at the code the price for making it public sounds a bit steep to me.
I do have some ideas on making this project better though, and since I have been using this application ever since I found DCoT, I will probably take a shot at improving it myself.
As this is now an open source project, are you (Tim) going to maintain the versions that are under development ? It might also be worthwhile to create a prioritized (MoSCoW ?) list for the improvements.
Two things that I would like to see are;
- Sub menu’s (Must have)
- Some easier way of adding menu items, i.e. removing the need to update the ini file that contains the menu definition. I’m thinking of drag-and-drop. (dropping an exectable onto the menu ?) (Should have)Cheers,
Ray

