Saturday, March 10, 2012

Adding a HTML link in your Windows application

Desperately seeking for an audience, I wanted to do include a link to this site in the "about" box of a Windows application developed with Rad Studio Builder :


I did use in the past Windows API function "ShellExecute", passing to it the application to launch (ex. firefox.exe) and the given parameters, (ex: http://mysite.com). but my problem was to find the user's default browser to launch it. Remembering how difficult it was to find out the local IP address, I said to myself "Guyt, your in for a treat".

Well, actually reading more carefully Microsoft's documentation on "ShellExecute" taught me that I didn't need to know the defaut browser!

http://msdn.microsoft.com/en-us/library/windows/desktop/bb762153%28v=vs.85%29.aspx

The trick is simply to specify the "open" operation on given link and it's done.

Here's the code that handles my "OnClick" event on the label that contains the link in its "Caption":
void __fastcall TfrmAbout::lbLinkClick(TObject *Sender)
{
ShellExecute(NULL, L"open",lbLink->Caption.c_str(),NULL, NULL, SW_SHOWNORMAL);
}
Don't we love it when it's that easy?

Thursday, March 8, 2012

A good Resource Editor (.res, .dcr)

Big news, Borland Resource Workshop is not working anymore on Windows 7. I used it mostly to create bitmaps for my Delphi/Builder C++ components.

But Google is good to me, so I found this wonderful freeware:


It's called Resource Editor and it is written in Delphi by Anders Melander.

Check it out: http://melander.dk/reseditor/

Monday, March 5, 2012

Reading Help Files in Windows 7

Call me a nostalgic, but do I hate the help system that comes now with recent development tools like Embarcadero XE2. Help files (.hlp) were so much easier and faster to use.



To my big disappointment, they didn't work anymore on Window 7. Or, at least until I found this on internet:

http://www.microsoft.com/download/en/details.aspx?id=91

Welcome back Win32.hlp !!!