What is the difference between Full Windows Touch Support and Limited Touch...
In the System control panel and in the PC Info section of the PC & Devices section of PC Settings, your device's pen and touch support can be reported in a variety of ways. Here is the matrix: No...
View ArticleIf 16-bit Windows had a single input queue, how did you debug applications on...
After learning about the bad things that happened if you synchronized your application's input queue with its debugger, commenter kme wonders how debugging worked in 16-bit Windows, since 16-bit...
View ArticleSome light reading on lock-free programming
Today is a holiday in the United States, so I'm going to celebrate by referring you to other things to read. I'm going to start with a presentation by Bruce Dawson at GDC 2009, which is basically...
View ArticleA user's SID can change, so make sure to check the SID history
It doesn't happen often, but a user's SID can change. For example, when I started at Microsoft, my account was in the SYS-WIN4 domain, which is where all the people on the Windows 95 team were placed....
View ArticleCounting array elements which are below a particular limit value using SSE
Some time ago, we looked at how doing something can be faster than not doing it. That is, we observed the non-classical effect of the branch predictor. I took the branch out of the inner loop, but...
View ArticleMicrospeak: Redlines
To the outside world, redline can mean to mark something for removal, or it could mean the maximum safe speed of an engine. But in the world of Microsoft design, the term redlines (pronounced as if it...
View ArticleWhat happens if I don't paint when I get a WM_PAINT message?
Suppose your window procedure doesn't paint when it gets a WM_PAINT message. What happens? It depends on how you don't paint. If you have an explicit handler for the WM_PAINT message that does nothing...
View ArticleIf my WM_TIMER handler takes longer than the timer period, will my queue fill...
A customer was worried that they may have a problem with their message queue filling with WM_TIMER messages. "If my WM_TIMER handler takes longer than the timer period, will my queue fill up with...
View ArticleKilling a window timer prevents the WM_TIMER message from being generated for...
Calling KillTimer to cancel a window timer prevents WM_TIMER messages from being generated for that timer, even if one is overdue. In other words, give this sequence of operations: SetTimer(hwnd,...
View ArticleCreating double-precision integer multiplication with a quad-precision result...
Suppose you want to multiply two double-word values producing a quad-word result, but your processor supports only single-word multiplication with a double-word result. For concreteness, let's say that...
View ArticleThe psychology of confirmation, or something, I don't know what to call it
There is probably a name for this phenomenon. I will illustrate it below. "Is there a way to configure the system to do X?" — Go to the Y dialog and select Z. "It doesn't work." — I just tried it. It...
View ArticleIf you get a procedure address by ordinal, you had better be absolutely sure...
A customer reported that the GetProcAddress function was behaving strangely. We have this code in one of our tests: typedef int (CALLBACK *T_FOO)(int); void TestFunctionFoo(HINSTANCE hDLL) { //...
View ArticleWhat states are possible in a DRAWITEMSTRUCT structure?
The DRAWITEMSTRUCT structure has an itemState member which contains a number of bits describing the state of the item being drawn. How do those states map to the underlying control? Most of the...
View ArticleDetecting whether a SID is well-known SID
You might think that the IsWellKnownSid function would tell you whether a SID is well-known, but it doesn't. Rather, it tells you whether a SID exactly matches the well-known SID you specified. For...
View ArticleNotes on calculating constants in SSE registers
There are a few ways to load constants into SSE registers. Load them from memory. Load them from general purpose registers via movd. Insert selected bits from general purpose registers via...
View ArticleWhen corporate policies meet precision scientific equipment
One of my colleagues used to work as an IT consultant, and one of his clients was a tobacco company. Since they were a tobacco company, the company policy on smoking was "You can smoke anywhere, any...
View ArticleIf you set up roaming profiles, you are expected to set up each machine...
A customer discovered the following behavior when they set up roaming user profiles on their domain. Consider two machines, 1 and 2. An application A is installed on machine 1, but not machine 2. A...
View ArticleIt rather involved being on the other side of this airtight hatchway: Account...
A security vulnerability report came in that went something like this: Disclosure of arbitrary data from any user An attacker can obtain arbitrary data from any user by means of the following steps:...
View ArticleIt's not too late (okay maybe it's too late) to get this gift for the...
A LEGO set to measure Planck's constant.
View ArticleHow can I query the location of the taskbar on secondary monitors?
A customer wanted to know how to get the location of the taskbar on secondary monitors. "I know that SHAppBarMessage will tell me the location of the taskbar on the primary monitor, but how do I get...
View Article