Archive for the ‘Builder’ Category

Base64 Encode and Decode - VCL

Posted on the June 30th, 2007 under Builder, [ En ] by Raz

Here is a way to Base64 Encode and Decode your string in Borland C++ Builder (VCL)…

Get User IP address

Posted on the June 16th, 2007 under Builder, C++, [ En ] by Raz

So, you need a way to get your user local IP address? Here is the winsock way.

Reporting formatted errors

Posted on the June 14th, 2007 under Builder, [ En ] by Raz

So, you want to report errors in a printf / sprintf way? Check this out…

Finding files…

Posted on the May 7th, 2007 under Builder by Raz


File version information

Posted on the February 25th, 2007 under Builder, C++, [ En ] by Raz

Q: How can I get file version information from my own exe/dll or any other file?
A: The VerQueryValue function retrieves specified version information from the specified version-information resource. To retrieve the appropriate resource, before you call VerQueryValue, you must first call the GetFileVersionInfoSize function, and then the GetFileVersionInfo function.

BPX (INT3)

Posted on the February 22nd, 2007 under Builder, C++ by Raz


Sorting a ListView

Posted on the February 17th, 2007 under Builder, [ En ] by Raz

Here is how you can use the OnColumnClick and OnCompare events of a TListView to let users sort the columns (ascending/descending) in a report-style list view by clicking on the column headers. This requires a global variable to keep track of the column that was clicked:

Drag & Drop Files

Posted on the February 10th, 2007 under Builder, [ En ] by Raz

How to enabled drag&drop from explorer to your window and retrieve a list of dropped files?

1. Enable your window (Form) to accept dropped files (DragAcceptFiles )
2. Add a message handler for WM_DROPFILES
3. Use DragQueryFile ( on WM_DROPFILES) to get the dropped files count and their full path.

Printing a TBitmap with StretchDIBits

Posted on the February 2nd, 2007 under Builder, [ En ] by Raz

  The simple way to print a TBitmap is to use the Draw method of a TPrinter Canvas ThePrinterCanvas->Draw ( PositionX, PositionY, TheBitmap);. This works, except that on many machines this will fail to print (or print out too small). The following code will print the TBitmap at a size that is adjusted for the printer device using StretchDIBits. You could change the scaling and have it print to whatever size you want…

Unicode files path

Posted on the January 27th, 2007 under Builder, [ En ] by Raz

  Checking if a file or folder exists with FileExists and DirectoryExists (VCL) will not work on Unicode files path, so here are the Unicode versions…

Message box with check box

Posted on the January 21st, 2007 under Builder, [ En ] by Raz

  Here is an easy way to make a custom message box with a check box bellow the buttons. No need for MessageBox hooks or any other “magics”, just plain VCL:

Disable XP Theme…

Posted on the January 13th, 2007 under Builder, C++, [ En ] by Raz

  So, you want to disable XP Theme applied on the entirely window or maybe just on a button? or any other control?