The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts

Suggestion Box 4

The topic backlog from Suggestion Box 3 has nearly cleared out, and I've actually been enjoying not having to write up a reply every Monday for the past several months, but all good things must come to an end, and so, without much fanfare, we now have Suggestion Box 4. Remember, the suggestion box is for suggestions for future topics. It isn't for developer support, bug reports, or ranting. Topics I'm inclined to cover: Topics I am not inclined to cover: Selected products at Microsoft participate in the Connect program, and many more have official blogs. Suggestions should be between two and fo...

Management-speak: Multi-perspective content

A colleague of mine visited an internal Web site for task ABC and found that the site was no longer there. Instead it was replaced with a simple message: Designed with the user in mind you will now find contextual ABC and DEF information served up in a secure format alongside all GHI information. Access to relevant multi-perspective content will enable faster resolution for your GHI needs. Translation:

To enable and disable a window, use the EnableWindow function

Commenter Chris 'Xenon' Hanson points out that fiddling with the style directly via leads to strange behavior. However it isn't the case that "most widget classes work fine." Reaching in and fiddling the style bit directly is like reaching into a program's internal variables and just changing the values: All the other work that is associated with changing the value simply doesn't happen. It's like taking a book you checked out of the library, re-shelving it, and then going into the library computer and marking it as "returned". The bookkeeping will say that the book has been returned, but all the other proce...

How do I launch the Explorer Search window with specific search criteria?

A customer wanted to know how to launch Explorer's Search window with specific fixed search criteria. It turns out that there are two ways of doing this, the poor man's way and the overachiever's way. The overachiever's way is actually easier to discover. You can use the search-ms protocol to generate a command string that describes the query you want to perform and pass it to . The poor man's way actually requires a little bit of out-of-the-box thinking: Open the Explorer Search window and interactively create the query you want to be able to relaunch later. Now do File, Save Search, and save the query. When...

There's always the low-tech way of managing a process, too

One of my colleagues had a problem with content management. I've changed the underlying scenario but the principle is the same. Is there a way to require that someone other than the author of a proposal sign off before the proposal tracking system accepts it? We had an issue where somebody wrote up a proposal, and due to a miscommunication, the proposal coordinator thought the proposal was ready and submitted it prematurely. This happened to another team in our group, and we want to make sure we don't make the same mistake. Another colleague explained: This is a people problem, not a technology problem. One w...

Why don't all the Control Panel applications show up when you open a menu from the address bar?

One of the features added to the Explorer Address Bar in Windows Vista is the ability to navigate quickly to an item by clicking on its name, or navigate to a folder's children by clicking the arrow that appears next to the item and selecting your destination. One customer reported that there appeared to be a problem with the Control Panel: Switch to Classic View, and then click the arrow next to the words Control Panel. The result is a dropdown menu that shows some but not all of the Control Panel applications. Is this a bug? No, everything is behaving normally. Recall that the dropdown menu shows things that...

Tips for planning your ship party

Not saying how I know.

What is the cost of WS_CLIPSIBLINGS if the sibling windows don't overlap?

Commenter Robert May asks via the Suggestion Box whether there is a penalty to pay for using when the sibling windows are not overlapping. When you use the style, the window manager clips out the portion of the client rectangle that is covered by sibling windows. This is usually desirable behavior; otherwise you end up with two windows trying to paint at the same location, and somebody is likely to get hurt. (The One notable exception is in dialog boxes, where some controls like the group box were designed to have other controls drawn on top of them.) The cost of this flag is that when it comes time to calcu...

What's the difference between LastWriteTime and ChangeTime in FILE_BASIC_INFO?

The structure contains a number of fields which record the last time a particular action occurred. Two of the fields seem to describe the same thing. LastWriteTime The time the file was last written to. ChangeTime The time the file was changed. What's the difference between writing to a file and changing it? I'm told that the difference is metadata. The LastWriteTime covers writes to the file's data stream (which you accomplish via the function). On the other hand, the ChangeTime also includes changes to the file metadata, such as changing its file attributes (hidden, read-...