Wyatt Says...
LinkLabel with the correct Hand Cursor
November 16th, 2008
2 Comments
If you’ve done any Windows Forms designing then you’ve undoubtedly used the LinkLabel control. You’ve also likely noticed its hideous look:

The ugliness of the LinkLabel that ships with Windows Forms is four fold.
- The repulsive navy blue color reminds me of Netscape Navigator (anyone else remember the graceful “Illegal Operation” crashes?).
- There’s no hover effect. OK, I lied. There’s a hover effect but you have to code it. And if you do code it, you better put on your epilepsy goggles – it’s gonna flicker.
- The non-standard hand cursor is missing the shadow and the gradient.
- The LinkLabel font is oddly rendered:

The Windows.Forms LinkLabel looks as though the text was drawn to the screen once, then drawn again without erasing the first copy. This gives the LinkLabel a jagged, “blocky” look.
LinkLabel2 - How I fixed it
It was a simple bit of code. I used ‘TextRenderer.DrawText(…)’ to do the actual drawing. The hand cursor was simply a matter of intercepting the WM_SETCURSOR message to my LinkLabel2 control:
[DllImport("user32.dll")]
public static extern int LoadCursor(int hInstance, int lpCursorName);
[DllImport("user32.dll")]
public static extern int SetCursor(int hCursor);
protected override void WndProc(ref Message m)
{
//WM_SETCURSOR == 32
if (m.Msg == 32)
{
//IDC_HAND == 32649
SetCursor(LoadCursor(0, 32649));
//the message has been handled
m.Result = IntPtr.Zero;
return;
}
base.WndProc(ref m);
}
}
But what about SysLink?
SysLink is a link control added to “ComCtl32.dll” in Windows XP. So, why not use SysLink? Because SysLink doesn’t exist in Windows 2000/98.
Maybe in 3 years, when Windows 2000 is dead, a simple SysLink wrapper for C# can be written.
Get it
It works with all the .NET 2.0 + languages (C#, VB.NET, etc.).
Also while you’re at it download wyUpdate, or any of my other open source projects.
Go to the LinkLabel2 site for further updates.
Open Source wyUpdate: Keep Your Users Up-to-Date
October 17th, 2008
3 Comments
For the last four years I’ve been developing wyUpdate under a tackier name: InstantUpdate. Today I’m officially dropping both the InstantUpdate name and its slightly perplexing logo for a nonsensical name with an even more perplexing logo. (And it’s purple!)
If you’ve never used wyUpdate, here’s a quick intro: wyUpdate comes in two parts. The first part is the wyUpdate Designer to manage your versions and create your updates. The other part is the wyUpdate Client which you include with your application, and it does all the checking and updating of your program.
The wyUpdate Client: Open Source
The wyUpdate Client is now completely open source. It’s licensed under the BSD license (the most liberal open source license) and the zip file containing the C# sources is available for immediate download.
The wyUpdate Designer: Two Choices
The wyUpdate Designer has two editions: the wyUpdate Professional Designer and the wyUpdate Express Designer.
The wyUpdate Express Designer is free, but limited in features and in licensing. Specifically, you can only use the wyUpdate Express Designer to create updates for products that are free or are open source.
On the other hand, the wyUpdate Professional Designer has no limitations. You can use it on free, open source, or commercial products. So, if you’re selling your program wyUpdate Professional is for you.
Additionally, the wyUpdate Professional Designer has two major features that will help small and large software companies alike. The first of which is version management.
Version Management
Managing past and future versions of your software is simple. Just drag the files into the wyUpdate Professional Designer window. Adding registry modifications is just a simple and intuitive. You won’t even need to visit the help documents or the forum (but they’re there just in case you get stuck).
Update Patches
The second major feature in wyUpdate Professional is patch creation. A patch is the data required to get from one version of a file to another:

The patches created by wyUpdate Professional are much smaller than the zipped files created by wyUpdate Express. And much much smaller than releasing a new installer for every update to your program.
An example to illustrate my point is Nero Burning ROM. Nero Burning ROM is CD/DVD writing software that has been popular for many years, and Nero is updated frequently. One big problem, though, is their lack of a good update creation and distribution method. Instead of using a program like wyUpdate, they release full installers as their updates. That’s over 300 megabytes for very small changes to Nero.
The graph below shows how enormous just the bare minimum installation of Nero Burning ROM is. Notice the tiny size of the update when created with wyUpdate Professional Designer (just over a megabyte!):

Why should you care?
Because your users care. It’s no coincidence that I used Nero Burning ROM as my example. They have a very large user base. Their computer savvy users like to use the latest version of Nero. But every time an update to Nero comes out this same complaint is raised again and again:
Why do I have to download 300 megabytes when all I’m using is the main Nero program?
And that’s the non-vulgar version of what’s being said about Nero.
For every new release of Nero their reputation should go up – not get worse by all the bad buzz surrounding their slow, bloated, distribution system.
Hawking wyUpdate Professional
Ok, ok. You get it. I’m trying to sell wyUpdate Professional. Even for all my shameless plugging, a program like wyUpdate Professional is necessary to keep your users happy. My program can create tiny updates that download quickly and install quickly. This saves you money on bandwidth costs all while keeping your users deliriously happy.
(Hell, you can even create a competing product using the open source wyUpdate Client. But I think you’ll find the $85 is a small price to pay for the monetary benefits of using wyUpdate Professional.)
Download wyUpdate Express
It’s free and includes a trial of wyUpdate Professional that automatically downgrades to wyUpdate Express after 20 days.
Buy wyUpdate Professional
If you’re not satisfied, for any reason, within 90 days you get a full refund. No questions asked. I don’t want your money if you’re not incredibly happy.
Peppier Website
October 11th, 2008
5 Comments
Today I changed the style of wyDay.com to be much brighter. I felt that if this site didn’t burn out your retinas while simultaneously giving you a cavity, then it just wasn’t good enough.
A notable addition to the site is the open source list. It lists the dedicated pages for VistaMenu, SplitButton, wyUpdate Client, and some of my older projects.
I’ve also uploaded version 1.0 final of wyUpdate (a.k.a. InstantUpdate). I’ll have a blog post later on explaining all of the many changes. But, for now, just download wyUpdate and begin exploring. It was designed to be easy to use right out of the box.
RSS feed
Wyatt's Twitter feed