Raymond Chen

Raymond has been involved in the evolution of Windows for more than 25 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He currently appears regularly on MSDN Channel 9’s One Dev Minute channel in the One Dev Question video series.

Post by this author

Scrollbars bart 6 – The wheel

The mouse wheel is tricky because the mouse wheel UI guidelines indicate that you should scroll by a user-specified amount for each "click" of the mouse, where one click is WHEEL_DELTA mouse units (called a "detent"). There are two subtle points about the above requirement: First, that the amount of ...
Comments are closed.0 0
Code

Limitations on DLL resources in Windows 95

Ancient history lesson. When Win9x loads a 32-bit DLL, it creates a shadow 16-bit DLL so 16-bit code (like USER) can access resources in it. The shadow DLL is effectively a resource-only 16-bit DLL, created by taking the 32-bit resources and converting them to 16-bit format. ...

Keyboard accessibility for scrollbars

Note that so far, the scrollbar is accessible only with the mouse. Our next step is to add keyboard access to the scrollbar. Fortunately, this is not all that difficult. We merely map some keystrokes to equivalent scrollbar actions. Note that this doesn't make our sample program fully accessible; this ...
Comments are closed.0 0
Code

Changing the Windows boot logo

This is the answer I give to IT people when they ask if it's okay to customize the Windows boot logo. DO NOT DO THIS ON A PRODUCTION MACHINE OR YOU WILL REGRET IT. If you hack the bitmap everything will seem fine until six months down the road when you decide to install the ...

Answer to previous exercise on proportional scrollbars

If you look at the WM_VSCROLL message, you'll see that the scroll position is a 16-bit value. So if the number of entries is more then 65535, you won't be able to use the scroll thumb to get to the ones at the end. Try it: Change the value of g_cItems to 100000 and watch what happens. The fix is to ignore the pos passed to the message and ...
Comments are closed.0 0
Code

Scrollbars, part 4: Adding a proportional scrollbar

To obtain a proportional scrollbar, you need to tell Windows the minimum and maximum values covered by the scrollbar, the current scrollbar position, and the size of the scrollbar thumb (called the "page size"). One annoyance of the way scrollbars are set up is that the maximum value is attainable. This ...
Comments are closed.0 0
Code

Answer to yesterday's exercise

iMin is the lowest-index element which intersects the paint rectangle, so a simple truncating division produces the desired index. The formula for iMax can be interpreted two ways. One is that it is the roundup of the first invisible line. Recall the rectangles are exclusive of the endpoint...
Comments are closed.0 0
Code

Why doesn't the new Start menu use Intellimenus in the All Programs list?

Common request: I want to be able to turn on personalized menus (Intellimenus) when in XP Start Menu mode. Imagine if Intellimenus were enabled with the XP Start Menu. You use 5 apps; the rest are not used much. (Studies show that 5 is the typical number of unique ...

Scrollbars, part 3: Optimizing the paint cycle

Observe that we paint all 100 lines in our paint handler, even though most of them aren't visible. This is a problem if there are a large number of items, or if painting an item is time-consuming. So instead, we optimize our paint cycle so as to paint only the elements which intersect the...
Comments are closed.0 0
Code

Why doesn't Windows have an "expert mode"?

We often get requests like this: There should be a slider bar somewhere, say on the Performance Tab, that ranges from Novice to Advanced. At the highest level, all the geek settings are turned on. At the Novice level, all the settings for beginners are turned on. In between, we can gradually enable stuff...

Feedback usabilla icon