The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
If you're asking somebody to help you, you want to make it easy for them, not harder
A customer liaison asked a question that went roughly like this: From: Liaison My customer is having a problem with the header file winfoo.h. The environment is Windows Vista German SP1 with Visual Studio 2008 Professional German SP1 and Windows SDK 6000.0.6000 German. When they try to include the file in their project, they get an error on line 42. "The character ';' was not expected here." Can somebody help? From: Raymond Can somebody please attach a copy of the offending file? There are many versions of winfoo.h, and it's not clear which version comes with Visual Studio 2008 Professional German SP1 +...
How do I get the tabbed dialog effect on my own custom tabbed dialog?
CJ observed that the standard tabbed dialogs provide an effect on the tab pages and want to know how to get the tabbed dialog effect on custom dialogs. fds242 noted this as well and wanted to know why the automatic tabbed dialog effect doesn't kick in until you put a static control on the child dialog box. Let's look at the first question first. To get the tabbed dialog effect, you can call with the flag. The best time to do this is in the handler, but you can also do it immediately after the dialog has been created. (Basically, you want to do this before the dialog paints for the first time, so as to avo...
How do I parse a string into a FILETIME?
Public Service Announcement: Daylight Saving Time ends in most parts of the United States this weekend. Other parts of the world may change on a different day from the United States. The NLS functions in Win32 provide functions to convert a into a string, but it does not provide any functions to perform the reverse conversion. Here are few things you can try: The OLE automation conversion function converts a string into a . From there, you can convert it to some other format. If you have something in which parses CIM datetime format (which The Scripting Guys liken to Klingon) you can use the obj...
When you synthesize input with SendInput, you are also synthesizing the timestamp
A customer was reporting a problem when they used the function to simulate a drag/drop operation for automated testing purposes. I see the mouse move from one location to another, and the starting and stopping locations are correct on the screen, but the mouse moves instantaneously rather than waiting 500ms between operations. Here's how I'm sending the input. Well, yeah, all the events occur immediately because you submitted them all at once. The field in the structure is not for introducing delays in playback. Though I'm not sure what the customer thought the field was. They say that they want a 5...
The TEMP directory is like a public hot tub whose water hasn’t been changed in over a year
All sorts of germs.
The wisdom of seve^H^H^H^Hsixth graders: Living without electronics for a week
Sixth grade students (ages 11 to 12, roughly) were instructed to imagine that they have no television, computer, or telephone for a week and write an essay (in the form of a letter to their parents) on what they would do with their time and why. The assignment was given under standardized test conditions: 90 minutes with nothing but pencil and paper, with an additional hour available upon request. (In practice, few students ask for the extra hour.) Remember, these are only the funny sentences/excerpts. Do not assume that all students write like this. Stage One: Denial Stage Two: Anger Stage Three: Bargain...
Keyboard shortcut for resizing all columns in a listview control to fit
The keyboard shortcut for resizing all columns in a report-mode (also known as Details mode) list view control to fit the current content width is Ctrl+Num+. That's the + key on the numeric keypad. (If you're using Explorer, you can also right-click the column header and choose Size All Columns to Fit.) Note that this command is a verb, not a state, so it takes into account the contents of the listview at the time you press the hotkey. If the contents change and you want the columns resize based on the new contents, you'll have to press the hotkey again.
In the conversion to 64-bit Windows, why were some parameters not upgraded to SIZE_T?
James wonders why many functions kept for parameter lengths instead of upgrading to or . When updating the interfaces for 64-bit Windows, there were a few guiding principles. Here are two of them. Don't change an interface unless you really need to. Do you really need to? Changing an interface causes all sorts of problems when porting. For example, if you change the parameters to a COM interface, then you introduce a breaking change in everybody who implements it. Consider this hypothetical interface: And here's a hypothetical implementation: Okay, now it's time to 64-bit-ize this puppy. So you do...
Whether the Unicode Bidi algorithm is intuitive depends on your definition of "intuitive"
In Windows, we spend a good amount of time with the pseudo-mirrored build. And one of the things that you notice is that pseudo-mirrored text comes out looking really weird. For example, the string really? (yup). comes out pseudo-mirrored as .(really? (yup. Just for fun, here's here's how your browser renders it: really? (yup). Even stranger, the IPv6 address 2001:db8:85a3::8a2e:370:7334 comes out as db8:85a3::8a2e:370:7334:2001. (The IPv6 address was the string that prompted this article.) The result of the RTL IPv6 address is even weirder if you force a line break at a particular point. If your browser ...