posted on Tuesday, February 28, 2006 2:28 PM by Jonathan Hodgson

Little touches to improve Windows desktop applications

If you are writing rich-client applications for the Windows desktop there are lots of little touches you can do to improve the end-user experience.

One nice feature is "Registering an Application to a URL Protocol" which basically means registering an application to a url protocol like http: but using your own made up one like outlook: or phone:. Say your application provided telephony features like connecting your desktop PC to your desk phone, then by adding a simple entry in the registry your users (who already have application installed) can launch it from a url like Call Support Desk and the Windows shell would execute "yourphoneapp.exe phone:01234 56789" where you can then parse the command line arguments.

On the subject of command line arguments, if you have a single instance application and want the command line arguments passed to it from a newly launched instance follow the steps answered in the second question.

Remember most Windows development is based on the Win32 API, so to start off you often need to use a combination of Spy++ and the Windows SDK to find out Win32 API methods occur. One of the best places to start for Winforms Win32 API help is PInvoke.net wiki.

Then in a C# Winforms application you would override the Winproc method and handle them yourself to change dragging behaviour, etc.

Raymond Chen also talks about only repainting the visible part of the screen, detecting when a workstation is locked (code in C#) or running over remote desktop client (RDP). Adding these relatively simple tricks can make your application a much better citizen.

 

Comments