Dan Mackey On ColdFusion Development

ColdFusion, Java, .NET, AJAX, DHTML development and general programming. Daniel is owner and Administrator of CFTagStore.com and works for an Application Development Company in Ireland called Digital Crew. His interests cover all areas of programming in multiple languages with a particular interest in Internet Technologies.

All Articles tagged : Windows Dev
2007-05-08 12:19:00.0

Initial thoughts on Apollo

Just back from Edinbourgh and a load of emails and blog comments to catch up on tonight but something that sprung up out of necessity was Adobe Apollo, specifically FineTune Desktop Player.

Since Pandora no longer allows access to listeners outside of the US, I was tipped off to another similar service called FineTunes. Its quite different to say the least and I am still getting used to it. I kinda preferred Pandora with the rating and interface but I thought I'd give it a whirl!

The important thing, and the reason for this blog post is that the desktop player uses Apollo. When Apollo was first released, I was excited and downloaded the sample apps and was impressed. Specifically, I downloaded the RSS reader. Bit sluggish on the menu items but overall great potential.

Onto FineTune Desktop.

Now, I realise Apollo is Alpha so I will only focus on what I think is required to truley make a desktop app in this environment plausable.

Installing the app was fast an straight forward. The interface was nice. It worked first time.

Then some strange things happened. All of a sudden, Apollo crashed with out warning. No biggie, its alpha. Loaded it up again. After about 5 mins of having FineTune open, I instinctively right-clicked and got the god-damn flash context menu. Again, Adobe has restricted using this functionality. This is annoying. Desktop apps should have access to a context-menu.

Then I opened the help window and a child-window spawned. Everything was fine until I closed that window and a debug window popped up telling me that the parent window could not be written too because a child-window blocked focus. The FineTune program was no longer accessible from the taskbar or alt-tab but the music was still playing. I had to end it in processes of task manager. Small glitch that was annoying but acceptable seeing that Apollo is alpha and maybe it will be sorted soon.

Now, Pandoras Box was something I wrote because I wanted music playing without a closeable window on my taskbar. I instinctively clicked the closed button on the FineTune player only to have the whole thing close. Damn I thought, there must be no way for Apollo to run in the task-tray.

This is something that needs to be available to developers wanting to use Apollo. Most little apps I want to write using Apollo would need this functionality. If I want to use the RSS reader, I would expect this. If I wrote an IM app, I would expect this. If I have a music player, I would expect this.

So, I have decided I am going to have a lash at making FineTunes Box. I will take the flash player and use some of the existing code I have from Pandoras Box and make a player I can minimise to the tray. Apollo is a great concept and from poking around, its basically a web browser in desktop app, very much like Pandoras Box with the fantastic advantage of being cross-platform.

Apollo has a great advantage over something like Microsoft ClickOnce in that it is cross-platform but .NET is so much more flexible and has a great supporting IDE for developers. It does though have a huge foot print in the .NET runtime. I was impressed with the Apollos small download.

To sum up, Apollo (I think) needs:

  • Proper access to useful libraries to manipulate the host computer. i.e: Access to the file system, devices etc
  • An option to have the Apollo host run in the task tray and attach a context menu to the icon
  • Access to a context-menu in the Apollo application running
  • Simplified ways of accepting global hot-keys

I would love to hear other peoples ideas on the above and maybe some insight from developers who know more about the Apollo platform than me. Maybe these things are available or in the pipeline? Anyone else want to see a FineTunes Box application?

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [5] - Leave a comment
2006-10-13 11:59:00.0

Pandoras Box Updated - Pandora API 2 Supported

Sometime in the wee hours of this morning, Pandora released a new version of the player which added a number of new features.

One of these features was the new Pandora Events API Version 2. This broke the way Pandoras Box retrieved the current song and artist. This is now resolved.

Also the Station Quick Mix is now supported.

I also took this release to add Pandoralicious Station Browsing facilities.

You also have the option of logging all songs you like to a text file to explore later.

There is one more nice fature in there but I'll post on this later.

If you are upgrading to a the latest version, I would recommend un-installing the last version completely before installing this version. If your lazy and you dont un-install you probably wont have any issues :-)

Thanks to all who donated to the PayPal beer fund. Very much appreciated! I you havent done so yet and you appreciate the application there is no time like the present ;-)

DOWNLOAD LATEST VERSION - V1.3.3

You can find out all about Pandoras Box and read about the initial version here :

Pandoras Box - System Tray Wrapper Application For Pandora

Thank you to everyone who contributed comments, suggestions and encouragement. As always donated beer money goes along way to encourage development so if you like and use Pandoras Box, please consider clicking the donate button :-)

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [33] - Leave a comment
2006-09-27 12:02:00.0

Pandoras Box V1.3.0 Released

I was going to hold off on this release to add a few extra features but after so many emails for the features I had complete I said I would delpoy it while I finish the other items.

This version contains:

  • Popup notifications on song/artist change
  • Setting to enable/disable notifications
  • Copy-To-Clipboard functionality
  • New menu system for right-click
  • Fixes flicker issue on dual-monitor setups
  • Option to show/hide in taskbar.
  • If shown in taskbar, it now shows in the ALT+TAB list

If you are upgrading to a the latest version, I would recommend un-installing the last version completely before installing this version. If your lazy and you dont un-install you probably wont have any issues :-)

I'll be working on the new features shortly. Your going to like them!!

Thanks to all who donated to the PayPal beer fund. Very much appreciated! I you havent done so yet and you appreciate the application there is no time like the present ;-)

DOWNLOAD LATEST VERSION - V1.2.9

You can find out all about Pandoras Box and read about the initial version here :

Pandoras Box - System Tray Wrapper Application For Pandora

Thank you to everyone who contributed comments, suggestions and encouragement. As always donated beer money goes along way to encourage development so if you like and use Pandoras Box, please consider clicking the donate button :-)

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [15] - Leave a comment
2006-09-18 23:15:00.0

Pandoras Box - Updates

Just a quick note on the latest additions to Pandoras Box

  • Now posts to Windows Messenger to show the currently playing song
  • Control Pandora from the menu by right-clicking on the taskTray icon
  • New lyrics window to pull lyrics for the currently playing song
  • Support for global keyboard media keys - Pause/Play, Vote Dislike, Vote Like, Next Song
  • Single Click SHOW/HIDE
  • Does not show in taskbar
  • Check to see if you have the latest version
  • Additional access to menu items via right-click on tray icon
  • Ability to change Stations from the right-click menu on the tray icon. See the comments of this post for more info...

(Read More on development)

DOWNLOAD LATEST VERSION - V1.2.9

You can find out all about Pandoras Box and read about the initial version here :

Pandoras Box - System Tray Wrapper Application For Pandora

Thank you to everyone who contributed comments, suggestions and encouragement. As always donated beer money goes along way to encourage development so if you like and use Pandoras Box, please consider clicking the donate button :-)

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [36] - Leave a comment
2006-09-11 23:12:00.0

Scriptable Browser Tag To Send Free O2.ie SMS Texts

Since we set up CFTagStore.com 4 years ago, I have tried many different things to get free SMS text alerts on our sales. With on average 4 sales a day multiplied by 365 at 13 cent per text, we were literally spending too much (189.80 Euro) on something as trivial but necessary as text alerts on sales.

If all 3 people who are involved in the running of CFTagStore.com were to pay for the SMS alerts, we would be 569.40 Euro out of pocket. (Over 4 years - 2277.60 Euro)

The SMS alerts are important to us as sometimes an extra human intervention is needed to successfully deliver the soft products we sell so we used to be shelling that much cash out by sending an email to our O2.ie accounts and using their (rather unreliable and expensive) email-to-text alert service which at the time cost 13 cent per message.

One day, the O2 email-to-text service went down and didnt return for 2 weeks. I wrote numerous emails to O2 explaining that we were paying alot for the service and it was important and got nothing but canned-responses back from a moron who didnt really understand the problem. The answer back? It is working. My answer back? Its not. Return canned-response? We will be upgrading our site in the future and will take your feedback into account.

It was then I said I would write my own app to use the free 500 texts (as it was at the time) to send the alerts to our phones for free. I had done a bit of work on an application that would log into eBay and scrape some information from a users logged in account. The way I went about is was a quick-n-dirty Windows application that used the Microsoft Browser Control coupled with the MS Scripting Control that was called using ColdFusion CFEXECUTE (as a custom tag) and capturing the STDOUT to return to CF. Another nice thing is that even though the core app is a Windows executable, there is no form as such so on the server, you actually never see anything running.

The application was flexible and you loaded it using a host of scripts (either VBScript or Javascript syntax was supported) which let me script a user travelling and clicking through a website. To the host website, it appeared that a user was genuinely using the site so none of the sites could block it in any way. This worked perfectly for years until O2 upgraded (and broke) their site. The security cert they implemented threw a modal security dialog on Internet Explorer (the basis of the Web Browser control I was using) which froze my app. There was no way of using sendKeys or anything to click OK.

Today I managed to tweak the registry on my machine to force the suppression of the dialog and so resumed my free texts through O2. Unfortunately, I lost my source code to the original app so wrote a quick-and-dirty version this evening specifically targeted at O2 and free texts so it doesnt have the generic scripting of the previous version but it does the job!

If anybody wants the code or have a situation in which they may benefit from a scriptable browsing scenario, just email me. I have often thought of adapting the core of the app to help in unit testing etc. Seeing as I lost my original code, on the side at night or in the evenings I am thinking of starting from scratch again and making the solution generic with possibly a wizard for creating the scripts.

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [3] - Leave a comment
2006-08-12 19:07:00.0

Wow - Pandoras Box Got The DIGG Effect!

I never really got into DIGG but when I saw the effect it had on my blog and all the spin off effects, I was addicted! 4500 people visited my blog on Friday - This is an average increase of 4450 people over normal days! Then people started linking to it from their own blogs - More traffic!! People posted the link to del.icio.us and I made the front page of that too!

I am literally over-the-moon with the effect Pandoras Box on Digg has had but with over 70 emails and a shed-load of comments, I had my work cut out today!

I made the app for my own use and decided I might aswell chuck it on my blog to download and got a bit lazy with the features. Lots of people love it for its simplicity but alot more asked for some extra features. I literally spent hours upon hours researching Javascrip and Flash integration, reading hundreds of pages on Windows APIs, Web Browser control, various DOMs and the official Pandora Event Notification Object.

There were 3 main things I wanted to fix, add :

  • Some people got an annoying "Object Required" popup. This was my bloody fault and I missed a debug setting when I packaged it up. This has been resolved!
  • The current playing song and artist is now displayed on the form caption and the tray control tooltip. This took a while and required a nice hack :-)
  • I wanted voting from the tasktray icon. I tried everything. If you saw the hacks I tried to implement to get this functionality, you would laugh! - I have not been successful so far!

Lots of people wanted the source code for the application and a technical overview on how it works. I am going to post both these soon.

The main problem with the voting from the tasktray icon is that I really have ZERO control over Pandoras flash object. They dont expose any functions I can hook into so everything is done with a hack. I got so far at one stage. I found out there are 2 keyboard shortcuts in Pandora itself PLUS and MINUS to vote Positive and Negative respectively. My idea was to focus the WebBrowser control and then use the Windows API or SendKeys function to simulate a keyPress on the focused flash object. No matter what I did I couldnt get it to hook and this also required the window to be focused so the tray hiding was making this null and void. Ah well, hopefully Pandora will release some sort of API and I will work my bollox off to include everything everyone asked for!

Anyway, enough with the waffle, I have uploaded the latest setup.exe file which has the improvements in it.

Click To Download

Upgrading Old Version
To be safe, I would recommend you uninstall the old version before installing the updated app. Also, make sure you close the old app before you uninstall/re-install :-) If your in a rush, belt ahead and install over the old app and click IGNORE on the install screen for any alerts....

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [7] - Leave a comment
2006-08-09 22:35:00.0

Wrapper Application For Pandora Running In Task Tray

I love listening to music while programming, sometimes I'm in the mood for Faithless, then some Prodigy and lately a bit of Johnny Cash. The problem is I have exhausted my supply of tracks so rely on Pandora - Genome Music Project to find me similar music I may never pick up in the shops!

The problem I found with Pandora is that even with a minimal window, it meant there was another Internet Explorer / Firefox window open cluttering up my screen and I accidently either close the browser or refresh the window! I always thought it would be cool to have it run in the tasktray like Winamp and so took an hour off this evening to develop what I am calling Pandoras Box



The basics are a WebBrowser Control hosted in an application with the ability to minimise to the system tray. You can double click the tray icon to bring the app back up. Additional features include an always-on-top option, sub-classing of the main app so only one instance launches, and the removal of junk around the player window.

 

DOWNLOAD VERSION 1 NOW

 

Anyway, as this is not endorsed by Pandora but may be useful to people and may attract more people to support Pandora, I better put some little disclaimer, so here goes :

Pandoras box is NOT endorsed, developed, supported etc by Pandora Genome Music Project. They probably wont even know about it or want to. I will answer suggestions and bug reports and will fix them in my own time but I do not claim responsibility for misuse of this application etc etc

Requirements:
This will run on most Windows machines and was explicitly tested and developed on WindowsXP with IE6.

You can find out all about the latest updates to Pandora's Box here :

Pandoras Box Updates - September 19th 2006

Thank you to everyone who contributed comments, suggestions and encouragement. As always donated beer money goes along way to encourage development so if you like and use Pandoras Box, please consider clicking the donate button :-)

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [67] - Leave a comment
2006-06-08 13:15:00.0

URL Protocol and Instancing Fun

As I posted here one of the applications I had to write recently as part of a bigger project was a Guarantee Certificate printing application.

People register for a guarantee certificate on the website and an email is generated with a Guarantee Certificate Number and sent to the marketing department of the specific company offering the guarantees. The person tasked with printing the certificates then took this number from the email and pasted it into my application which in turn both generated a graphical certificate and address label and sent the output of both to a colour printer and Dymo LabelWriter respectively.

Now, the problem here is the amount of time it takes to generate a certificate through this process. The copying and pasting from email to guarantee application was about 10 seconds and with about 70 signups a day, that was 700 seconds of someones time wasted coupled with the amount of time for both printers to actually print. Thats about 10 minutes alone to copy and paste.

I had to find a way of speeding it up and cut down on the monotonous task of copying and pasting.

I noticed that FeedDemon had a custom url protocol called feed:// which would launch the FeedDemon RSS reader when a feed:// link was clicked. This got me thinking about adding a custom URL Protocol called guarantee:// which would call my app and pass the guarantee number into it.

As with anything, if you know it can be done, its only a matter of time before you figure out how to do it yourself. I began to think what has to be set in Windows to allow this custom URL Protocol and thought of the registry. Doing a quick search through the registry gave me the answer.

This is what needs to be added to the registry:

My Computer\HKEY_CLASSES_ROOT\guarantee
My Computer\HKEY_CLASSES_ROOT\guarantee\(Default)=URL:Guarantee Protocol
My Computer\HKEY_CLASSES_ROOT\guarantee\URL Protocol=""
My Computer\HKEY_CLASSES_ROOT\guarantee\DefaultIcon\myApp.exe
My Computer\HKEY_CLASSES_ROOT\guarantee\shell
My Computer\HKEY_CLASSES_ROOT\guarantee\shell\open
My Computer\HKEY_CLASSES_ROOT\guarantee\shell\open\command
My Computer\HKEY_CLASSES_ROOT\guarantee\shell\open\command\(Default)="C:\Program Files\myApp\myApp.exe" "%1"

Now when someone clicks a link <a href="guarantee://234-343-34343">Certificate Number</a> my application is launched and the number is passed to it as a Command Argument

This led to another problem aside from parsing the Command$ input to get the number and strip out the URL Protocol call. My app instancing had to be corrected.

Obviously all I needed was one instance of my app running but the code to do this checked to see if my app was running and if it was killed the second instance of the app and using the windows handle of the previous app, activated it. When you do this though, you have to pass the command$ from the second app to the previous instance and call the load certificate function.

After reading and testing and reading and testing, the code was getting messy with alot of Windows API calls and dealing with Mutex calls and sub-classing. I was under pressure with time and just needed a quick and dirty solution and so used a simple .ini file as storage so the previous app would know what certificate to launch.

End result? Works flawlessly....

Moral of the post?
A quick an dirty hack, although not the correct way of doing things, sometimes works out more efficient time wise than re-writing a big part of the application if it achieves the goal you set out to achieve.

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [1] - Leave a comment
2006-05-16 15:19:00.0

ColdFusion Live Support Chat Application

About a year ago, I posted on my blog my thoughts on a ColdFusion based live support tool and that I was planning on prototyping my idea.

Well to update on this, I did actually write the application and had it working with a nice AJAX client application and a Windows Application running in the task tray for the operators.

I had it fairly advanced with the ability for operators to have multiple chat requests open at once, canned responses, visual and audio alerts etc

It was about 90% built with a good bit of testing to complete but I got pulled off it to work on various other projects and applications.

It is my mission to pick this project up again in the next few weeks after I finally get the latest version of CFForumsExpress shipped.

I would love to hear peoples ideas on a ColdFusion based live support tool....

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [4] - Leave a comment
2006-05-16 12:50:00.0

Easy Blog Posting For New Engine...

One of the reasons I stayed with Blogger for so long was the convenience of posting blogs.

Blogger hooks you in by adding Browser Toolbar blogging tools, Add-Ons to Word to allow blogging etc and it is something I kinda miss. Sometimes you want to do a quick post and not have to load up the full cms system.

I am thinking of using what I built for the Guarantee Certificates and adapting it to be a quick blog posting application that runs in the tasktray...

Because I am using the same engine as Peter I can also give him a copy of it an together we will be able to enhance our blogging app.

More details as I plan it...

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [2] - Leave a comment
2006-05-16 00:17:00.0

Windows Authentication and ColdFusion

Recently a project came up where we had to integrate user login information in our database with the users Windows Authentication on the network.

Peter did a great job of implementing this using the very handy CGI variable : #cgi.auth_user#

When a person logs in using WindowsNT authentication, ColdFusion passes the users login name in the variable cgi.auth_user

Peter kept a field in the users database called usersNetworkLogin and if the users session data was 0, he looked up the database against this variable. If a user was matched, he set the user logged in with session.loggedInUserId set to the users actual id from the database.

To save a dbs lookup in the future he set a cookie on the users machine.

This is a small bit of code and logic but has helped us out enormously on the Intranet project we were working on.......

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [3] - Leave a comment
2006-05-15 22:13:00.0

Freefoam Guarantee Application

Just completed a nice little application to help Freefoam staff print Guarantee Certificates and Address Labels.

The application was written in VB and uses a WebBrowser Control to display the online HTML based Certificates which are in turn generated using ColdFusion.

Each certificate contains META data which is polled by the VB app, de-serialized and transformed into a raster image which can be sent directly to a DYMO LabelWriter 400 Turbo printer. At the same time the label is printed, the HTML certificate is sent to a Colour HP Printer.

The user can enter a Certificate number and the correct certificate loaded in the browser control.

The application runs in the system tray and is instantly available for use by double-clicking the task tray icon.

Small App but one that was fun to write and saves a hell of a lot of time to the client.....

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [0] - Leave a comment
2006-05-12 17:59:00.0

Project Management Quick App

 
I am in desperate need of a quick application to manage my day-to-day projects and tasks. I have tried Gantt Project which is a good little Sourceforge Project but there are too many nuances and limitations. The biggest that turned me off was the inability to set a task in hours as opposed to days. This is ludicrous as all tasks need to be tracked and not all tasks take a day to complete. I have tasks that can take 10 mins to 2 hours.

Tonight I have a few hours spare and depending on my mood later and the amount of work I get done today, I am going to knock up a QAD (Quick And Dirty) personal project management app.

For ages I have been thinking about the best app to suit me. Peter and myself have great ideas on a full-blown app but we dont always agree on the way it should run.

This is what I want in mine until we finish our big app.
  • Ability to add Project Categories and Sub-Categories
  • Ability to add Projects
  • Ability to add Tasks to Projects
  • Quick access to the app
    - Tray Control
    - Fast task adding, deleting and editing
  • Simple reporting
  • ColdFusion based with AJAX for speed and usability

Tray Control

I need the app to be quickly accesible so I want a tray control app so when I right click, the menu pops up with my Cats, Projects and Tasks. Clicking on the task will complete it, start/stop the task etc. This could be fun the more I think about the features!

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [2] - Leave a comment