Last updated:
5. Apr 2005
(Start sub-menu)
User Interface Programming Column
Splitter Controls and Dialog Resizing
(End sub-menu)
User Interface Programming is the name of a monthly column I used to write for Windows Developer Magazine. The column was devoted to user interface issues that Windows programmers face; the “programming” in the title means that the column was hands-on and involved code.
I had three goals for each column:
Most of the code for these columns is in C rather than C++, on the theory that C is accessible to a larger number of readers. (Besides, the key point rarely depends on C++ features.) If you disagree, let me know.
The columns are listed in reverse chronological order (newest first).
Windows Developer Magazine, December 2002
In search of the Unholy Grail or Why Web Applications are Evil
Technology like the Windows Installer combined with .NET assemblies makes deploying feature-rich fat clients practical.
This article is available online. You can also read it on the WDM web site.
Windows Developer Magazine, November 2002
Analyzing an elemental user interface conflict involving the User32 library.
You can read this article on the WDM web site.
Windows Developer Magazine, July 2002
With a few modifications, you can get your specialized interfaces to adopt Windows XP’s user interface “themes.” Note that this stuff works only under XP.
I found the MSDN sample application Theme Explorer useful for exploring XP themes, but am no longer able to find it. If you know where it went, please drop me a note.
Windows Developer Magazine, June 2002
The Poor Man’s Split Bar isn’t up to complicated tasks. Here’s a full-featured replacement – a control that will divide a dialog into any number of freely resizable panes.
Windows Developer Magazine, April 2002
If an application displays a message box saying “Device Not Ready; Retry, Cancel?” and the device in question does become ready before the user acts, the message box should go away of its own volition.
This column explains one or four ways of achieving this. improving on a simple “device not ready” dialog box by eliminating the need for clicking on the “Retry” button to dismiss the message. There are several ways to create a “smart” message box, but this solution should be easier to maintain.
Windows Developer Magazine, February 2002
When you move a window, all destinations are not equally likely. This column shows how to make a window snap to the edge of the work area when it gets sufficiently close. It also shows how to confine a window to the working area of the screen.
Windows Developer Magazine, January 2002
Group boxes are weird things that can behave strangely during resizing. In this column I investigate a transparency problem submitted by a reader. The solution involves fiddling with style bits, and reveals just how complex a windowing system can be.
Windows Developer Magazine, December 2001
The range slider is an old idea that for some reason hasn’t been widely implemented. This column provides a fully working range slider that’s easy to use, along with some commentary on well-behaved controls.
The control described in the column is fairly simple. The version documented here is better.
Windows Developer Magazine, November 2001
The wait cursor provides important feedback for the user during lengthy operations. But if the mouse is moved in the meantime, restoring the right cursor rather than the original provides polish to your UI. And sometimes the best wait cursor is none at all.
Windows Developer’s Journal, October 2001
Guidelines for building user input validation into your programs.
Windows Developer’s Journal, September 2001
This one follows up on a previous column about “edit field hinting” and provides some alternative approaches to the problem of using empty edit fields to display hints for their usage.
Windows Developer’s Journal, July 2001
This month’s column continues the examination of scrolling, and what parts of it can be encapsulated in reusable code. After fixing some bugs and improving last month’s code architecture, I look at automatic scrolling. For example, if the user is drawing a rubber-band line and drags the cursor past the bottom of the window, you want the window to automatically scroll up to reveal more area.
Windows Developer’s Journal, June 2001
Most code to handle window scrolling looks very similar, so it ought to be possible to extract the relevant code into something reusable. That’s what this month’s column does, with some looks at Windows scrolling bugs and mouse wheel scrolling along the way.
Windows Developer’s Journal, May 2001
See also the split bar control.
Splitter windows let the user control how to divy up the space inside a frame window. Splitters can represent a lot of complicated code, but they can also be downright simple, as this column demonstrates by turning a dialog box into an Explorer-style window.
This code was later upgraded to deal with some problems pointed out by readers.
Frankly, this whole writing racket would be much simpler without readers. (Joke!)
Windows Developer’s Journal, March 2001
An edit control label provides some hint about what the user’s supposed to enter, but not much. One solution is a content hint—explanatory or example text that appears initially in the edit control, but then disappears when the user starts to actually enter content. This can be a slick solution—if you can implement it right.
Windows Developer’s Journal, February 2001
This month’s column is devoted to reader feedback and loose ends. The Pocket HTML control gets a W2K fix. James Holderness writes in to discuss the strange DrawAnimatedRects() documentation. Daniel W. Mathiasen writes of the evil TerminateThread(). I discuss the right way to handle CBN_SELCHANGE. Neil J. Rubenking inquires about AnimateWindow()’s AW_BLEND flag under Win98.
Windows Developer’s Journal, January 2001
A combobox is just an edit control and a listbox put together, so it should be easy to do anything to a combobox that you can do to an edit control or a listbox. If you’ve tried this much, you know that statement is often completely false. This column looks at how you would accomplish the simple-sounding task of changing the height of the combobox’s edit control.
Windows Developer’s Journal, December 2000
Last month’s column examined the new autocompletion and autosuggestion features for lists. This month’s column explores the detailed features for filename autocompletion, and supplies an example of what you have to do to make an edit field a drop target for files dragged from Explorer.
Windows Developer’s Journal, November 2000
The latest shell32.dll gives you some new features for saving users some typing: autosuggest and autocomplete features. This column demonstrates both features, pointing up some warts in the documentation and implementation along the way.
One year later:
Group boxes, tab controls and other “transparent” controls present a special challenge, which I discuss here.
Windows Developer’s Journal, October 2000
Resizable dialogs let the user change the default size to see more data, in a listbox or edit control, 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 automatic dialog resizing for most situations.
Windows Developer’s Journal, September 2000
A combobox is supposed to let you either select from a listbox, or enter a new item in an edit control. Unfortunately, under some circumstances, text that you type into the edit control disappears when you hit Enter. Here’s a fix that uses global subclassing to remedy the problem without requiring any changes to your existing dialog procedures.
Windows Developer’s Journal, July 2000
Although no longer an absolute requirement, the Windows window messaging model still has a strong single-threaded orientation. This column looks at some of the issues you should think about when you decide to involve more than one thread in your user interface, and includes a dialog that uses a background thread to update information from the Internet.
Windows Developer’s Journal, June 2000
One aspect of the user interface you probably don’t think much about is window creation—windows just appear, right? However, how they appear can give the user visual feedback about what caused them to appear, and where they appear on the screen can also affect usability. This column looks at window animation and window positioning.
Windows Developer’s Journal, May 2000
The standard controls are the workhorses of Windows user interface programming, but they lack some obvious features that many programs need. This month’s column adds a much-needed history feature to the standard combobox control.
Windows Developer’s Journal, April 2000
The default button is a great convenience for users, but it’s easy to end up with a dialog that sometimes contains a disabled default button, or paints a button as though it were the default, even though it isn’t. This column explores these problems and provides reusable code to help keep your dialog’s use of default buttons correct.
Windows Developer’s Journal, March 2000
To really reuse or build upon existing GUI code in Windows, you almost always need to use some form of window subclassing. This column looks at various forms of subclassing and provides a small library that provides safe (as safe as possible, anyway) subclassing.
You can read this article on the WDM web site.
The subclassing library is reused in many later columns. It has been upgraded once, in connection with Edit Field Hinting.
Windows Developer’s Journal, February 2000
How to subvert a static control to make it understand selected HTML tags such as <b> and </b>.
This column is in C++ rather than straight C, mostly because the std::string class greatly simplifies the HTML parsing.
(Start bottom menu)
Top •
Home
• Articles
• Book
• Resources
Windows Developer Magazine
• R&D Books
• CMP Books
Amazon.com
• Amazon.co.uk
• Contact Petter Hesselberg
(End bottom menu)
WDM has merged with Dr. Dobbs Journal.