Desktop applications (Microsoft Windows)
On occasion, the documentation for some aspect of the Microsoft Windows API does not go deep enough: it just scratches the surface of what it aims to explain. A few of the papers here try to augment the documentation with more details and in-depth coverage. There are no introductory articles on this site.
- The Microsoft Windows Palette Manager
Details on the palette manager of Microsoft Windows, with a focus on identity palettes. This is a highly technical description of what seems to be one of the less understood APIs of Microsoft Windows. The contents of this article are based on close readings of Microsoft's documentation, articles that uncover undocumented interfaces, many "black box" experiments and traces through GDI. With this article, you can also download a free "palette spy" utility that has assisted us frequently in spotting palette problems in our code.
Most recent update: changes in the Palette Manager in Windows 2000: one more static colour that turns out to be dynamic; extra settings for SetSystemPaletteUse().
- A gamma-corrected uniform palette (for Microsoft Windows)
A proposal for a general-purpose 256 colour palette. The palette contains the 20 "static colours" used by Microsoft Windows, a gray scale ramp and gamma-corrected colours.
- Microsoft WaveMix annotated manual
This page is the updated, corrected, annotated and expanded manual for WaveMix, Microsoft's real time sound mixing solution before the advent of DirectSound. This paper covers WaveMix version 1.80, a version that is quite a bit more convenient than version 1.50, but that nevertheless was never really distributed (you can get version 1.80 from this site as well).
Most recent update: A few clarifications in descriptions of the parameters to WaveMixPlay() and the WAVEMIX.INI file, plus a new section in typical mixing strategies.
- Accurate frame timing in Visual Basic
How to improve the accuracy of timed events under Windows. The code snippet is in Visual Basic, but the principles apply to all Windows
Most recent update: Notes for the timer accuracy on Windows 2000/XP (and improving it), plus a change to avoid monopolizing the CPU.
- Detecting Vertical Retrace in Microsoft Windows
Synchronizing display updates with the vertical retrace of the monitor can reduce flicker, tearing and other artefacts. The vertical retrace is a real time event and, under a multitasking operating system like Microsoft Windows, that requires some consideration. This article covers Windows 3.x, Windows 95/98 and Windows NT/2000.
Most recent update: Updated source code for the kernel drivers (correction of a bug that occurred under rare circumstances). In addition, the page sheds a few words on installing the Windows NT/2000 kernel driver, because it is a source of much confusion.
- Cloning a registry branch
This article presents a function that copies all values and keys below a given key in the registry to another key. It is a recursive function, that you can plug in directly into C and C++ projects. The article also explains why cloning a registry branch is sometimes needed (with updated information on installing filter drivers for the LeadTOOLS multimedia kit).
- A tiny DrawHTML() function
DrawHTML()is a drop-in replacement for the standard
DrawText()function from the Platform SDK, and it supports a (very) limited subset of HTML tags. The function was initially developed for the Callout control published in Dr. Dobb's Journal; the page has a few errata for the article too.