Last updated:
3. June 2002

User Interface Programming

(Start main menu) Home ­ Articles ­ Book ­ Resources (End main menu)

Code Archive

(Start sub-menu)


User Interface Programming Column


Tech Tips


Code Archive

Range Slider

Splitter Controls and Dialog Resizing



My blog »

(End sub-menu)

Here is the most popular reusable code from the User Interface Programming column. This is exclusively code that you just plug in, and it works—you don’t have to change your existing programs, be they straight Win­dows API or MFC.

The article lists include all existing download links; this page only lists the most popular.

Module Description
Window Subclassing

Demo (20KB)
Code (4KB)

To really reuse or build upon existing GUI code in Windows, you almost always need to use some form of win­dow subclassing. Here is a small subclassing library that provides safe (as safe as possible, anyway) subclassing.

The article describing this library is available online at the Win­dows De­vel­oper Maga­zine web site.

Dia­log Resizing

Demo (14KB)
Code (20KB)

Resizable dialogs let the user change the default size to see more data, in a listbox or edit con­t­rol, for example. A feature-rich layout manager requires a lot of code to do right, but here’s a modest implementation that can easily handle auto­matic dia­log resizing for most situations.

Default But­ton Fix

Code (4KB)

The default but­ton is a great convenience for users, but it’s easy to end up with a dia­log that sometimes contains a dis­abled default but­ton, or paints a but­ton as though it were the default, even though it isn’t. Here’s some reusable code to help keep your dia­log’s use of default but­tons correct.

The World’s Smallest Icon Editor

Code (77KB)

Icon editor as a reusable DLL. Also demonstrates how to make a DLL as small as possible by removing unnecessary CRT stuff.

Text Editor

Install (125KB)
Code (248KB)

TextEdit: The text editor from my book Programming Industrial Strength Windows.

Range Slider

Demo (19KB)
Code (22KB)

Range Slider Article
Extended Range Slider documentation

(Start bottom menu)

Win­dows De­vel­oper Maga­zineR&D BooksCMP Books Petter Hesselberg

(End bottom menu)

This code is offered “as is,” with no warranties on my part and no obligations on your part. Use it any which way you like, be your purpose commercial or personal.

All demo or installation links are directly executable, while all code is zipped.

You can get the WinZip pro­g­ram through the link below.

WinZip Logo

Executable downloads have been compressed using UPX. This is a free Open Source prod­uct well worth your at­ten­tion.