When designing your user interface, be mindful of the selection-readers
Occasionally, there will be a feature along the lines of "Whenever the user selects some text, we will pop up an X." And then I have to remind them about so-called selection readers. Selection readers...
View ArticleUnder what conditions can SetFocus crash? Another debugging investigation
A customer asked, "Under what conditions can SetFocus crash?" We have been going through our error reports and are puzzled by this one. The call stack is as follows: user32!_except_handler4...
View ArticleHow can I make the touch keyboard appear automatically when focus enters an...
By default, the Windows 8 touch keyboard does not appear automatically when focus is placed on an edit control in a desktop program. To change the behavior for your program, just use this one weird...
View ArticleWhy do events logged by the ReportEvent function show up in the wrong order...
A customer observed that when their service logs multiple events in rapid succession, they sometimes show up out of order in Event Viewer. Specifically, the order of events that all occur within the...
View ArticleAdding a little marker to your comments in Microsoft Word
This is a trick I learned while participating in a document review meeting. Before the meeting each reviewer reads the document and adds comments. All the reviewers and the document author get...
View ArticleWhat's the point of giving my unnamed object proper security attributes since...
Recall that the NULL DACL grants total access to everybody. Both parts of this sentence are important to note. Everybody: This means everybody. No authentication required. It includes Guest. It...
View ArticleThere is no /8TB flag on 64-bit Windows
A customer reported that their 64-bit application was crashing on Windows 8.1. They traced the problem back to the fact that the user-mode address space for 64-bit applications on Windows 8.1 is...
View ArticleHow can I reposition my controls so they aren't covered by the touch keyboard?
Last week, we saw how to tell the Windows 8 touch keyboard to appear automatically in a desktop program when focus enters an edit control. But we did nothing to prevent the touch keyboard from...
View ArticleBitter or acerbic? or does it make a difference?
One of my colleagues told me that my name came up in conversation, and somebody said that they thought I had a reputation for being bitter. My colleague defended me. "Nah, Raymond isn't bitter. He's,...
View ArticleTaking ownership of a file doesn't give you access, yet
A colleague of mine accidentally ran a command from an elevated command prompt rather than a normal unelevated command prompt. By default, files created from an elevated command prompt are owned by...
View ArticleKeep your eye on the code page: Is this string CP_ACP or UTF-8?
A customer had a problem with strings and code pages. The customer has a password like "Müllwagen" for a particular user. Note the umlaut over the u. That character is encoded as the two bytes C3 BC...
View ArticleHow can I force a CreateFile call to hang, in order to test something?
A customer was doing some testing and wanted to know if there was a way to force a call to CreateFile to hang, so that they can test their program's hang detection and recovery code. You can ceate...
View ArticleHow can I reposition my window so it isn't covered by the touch keyboard?
Last week, we saw how we could rearrange our window contents to avoid having the touch keyboard cover the edit control. But what if the touch keyboard covers the entire window? No amount of...
View ArticleOne way to make sure nobody reports problems with your Web site
I had ordered a service online, and the Web site said, "Do not close this window until you are done, because once you close the window, you won't be able to come back." Okay, fine. I just need to make...
View ArticleWhen you think you found a problem with a function, make sure you're actually...
On an internal mailing list, a tester asked if there were any known problems with the FindFirstFileEx function preventing a directory from being deleted and recreated. Our code creates a test...
View ArticleHow come the technique for launching an unelevated process from an elevated...
A customer was following the Execute in Explorer sample to launch an unelevated process from an elevated process. (A sample which I rehashed some time ago.) The customer reported that the resulting...
View ArticleWhy does the class name for Explorer change depending on whether you open it...
I noted some time ago that Explorer's original name was Cabinet, and that the name lingers in the programmatic class name: CabinetWClass. A commenter with a rude name points out that Explorer uses...
View ArticleRandom links on taking better pictures
I'm always interested in finding simple things you can do to take better pictures. Here are some links I've collected. Take better pictures of friends and family: Turn off your flash. Ten tips for...
View ArticleReinterpreting the bits of a 64-bit integer as if they were a...
Today's Little Program takes a 64-bit integer and reinterprets its physical representation as a double-precision floating point number. using System; class Program { static double...
View ArticleSorry for the interruption, but it doesn't happen often
Many years ago, my feature manager and I were called into the project leader's office for some reason or other, I forget exactly what. We were about five minutes into the meeting when the project...
View Article