Drive-list control

A drop-down list displaying drive names and icons

This tutorial will show you how to implement a drop-down list of all the logical drives installed on a Windows system. There are basically three major steps involved in achieving this goal, listed in the order that we will tackle them.

DriveList screen-shot

Customize date-time controls

Improve the apearance of the date-time control

This is quite a short tutorial. The purpose of this exercise to remove the spin-buttons from the edge of a date-time control. The result is a control with looks like an edit box, but behaves exactly like a date-time control. This picture will show you the effect.

The standard date-time control looks rather messy in my opinion, especially when several are clustored together like in the example shown above.

Memory Techniques - Part 1

Memory management techniques for large file editors

This article came about due to interest in the way my HexEdit application manages large files, but also my desire to document what I consider to be the core technology behind HexEdit. I will be describing not only the memory management techniques for loading multi-gigabyte files, but also the techniques I developed to allow extremely fast insertion and deletion from these large files.

Splitter Windows

An example of a splitter-bar used to separate two windows

Updated 5 Jan 2006

I've added a new sourcecode download from L.D. Blake who kindly sent me a great little splitter library called "Easy Split". From the readme:

"EasySplitter is a custom control, in library format, that can be used with Pelles C to implement a very simple splitter window. With EasySplitter you create a splitter bar as a windows control that you can size, move and stylize like any other windows control. All mouse capture and window drag operations are handled internally by the control itself."

Introduction to Printing

How to print from a Windows application.

This tutorial will show you how to print a correctly, including how to calculate the page margins. We are going to let the standard print and page setup dialogs do most of the hard work for us, but there is still a little work to do. In the example I will present won't do anything fancy - just work out the page margins, calculate how many lines per page and how many pages to print, and lastly draw a few lines of text.

Fixed-width Font Enumeration

How to enumerate all fixed-width fonts in a system along with their sizes

Enumerating fonts can be a little confusing, and unless you want to enumerate all fonts on your system, can be a little more difficult than MSDN suggests. This article will explain exactly the steps you need to use to find every fixed-width font on your system, and also enumerate every possible size for each individual font.

Using cards.dll API

How to access the cards.dll API

The aim of this article is to describe exactly how to use cards.dll, the dynamic link library that has shipped with all versions of windows since version 3.0. This library contains all of the playing card bitmapped images that games such as Windows Solitare use to display their graphics.

Masked Edit Input

How to filter specific keys-strokes from a standard edit control

This article will describe one method of implementing masked edit controls. There are loads of different ways to perform the masking operation, depending on how you want to restrict the user's input, but they all revolve around the same basic principles. The method presented here will allow an edit control to mask any ANSI character, thereby restricting the input to a subset of the ANSI character set.

Insert buttons into an edit control

How to insert a button into an edit control

This tutorial will show you how to insert a button into the non-client area of an edit control. The effect of this is very similar to the drop-down button in a combo box. However, there is the potential to do much more than simply display a drop-down arrow. The technique of inserting a button can actually be applied to any type of window. For this example we will use an edit control, but any other window could be used.

The picture below will give you an idea of what we are trying to achieve.

Win32 Tips & Tricks

A page presenting many useful tips for Windows programming


This section presents a few win32 programming tips that I have picked up whilst learning to program Windows. Please select a topic from the list below.


Subscribe to Catch22 RSS