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

EnumClaw, the function that never was

bhiggins asks about the mysterious function that existed in some versions of the Win32 documentation. I went digging through the MSDN archives and was close to giving up and declaring the cause lost, but then I found it: A copy of the documentation. EnumClaw The EnumClaw function returns the child or the parent of the window whose HWND is passed in. Parameters hwndParent [in] Handle to the parent window. Return Values If the function succeeds, the return value is the HWND of the child of the hwndParent window. If the window has no child, the return value is the HWND of the parent of the hwndPa...

2010 Q1 link clearance: Microsoft blogger edition

It's that time again: Sending some link love to my colleagues.

The great thing about URL encodings is that there are so many to choose from

A survey.

Non-Microspeak: Boiling the ocean

Some time ago, MSN Careers listed Boil the ocean as a workplace phrase you should learn. Thankfully, the phrase (meaning "to attempt something impossibly ambitious") is not currently in wide use in Microspeak. However, a friend of mine who works in another industry tells me that it is not only very much alive in his line of work, it became corrupted as it was imported. My friend's industry involves companies from around the world, and although the working language for meetings is English, most of the participants are not native speakers of the language. He suspects that the phrase boil the ocean was introduced ...

Ruth Bader Ginsburg, the yardstick for Wikipedia entries

I use Ruth Bader Ginsburg's Wikipedia entry as a yardstick for other Wikipedia entries. At the time I'm writing this blog entry, her Wikipedia article is 1600 words long. So 1600 words is how many words Wikipedia assigns to the 20th most powerful woman (and the most powerful female lawyer) in the world. By comparison, Wikipedia has collectively decided that the 2007 Philadelphia Eagles season merits 5500 words. The exploits of a lackluster last-place American football team therefore clocks in at 3.4 Ginsburgs. In a sense, Wikipedia says that a last-place football team's exploits is over three times more signif...

What happens to the control names in the IDE when my program is running?

nick_journals demonstrates some confusion about names in source code and their relationship to runtime behavior. A topic I am particularly interested in is the naming of controls, how it works... Every control gets a name from a developer...via the IDE (e.g btnOK) When using this function: GetWindowLong(handle,GWL_ID) it doesn't return the name itself but mostly a number or nothing. What is GWL_ID, the documentation isn't very clear on this. How does this whole system work, what are these numbers and where are the 'real' names? I'm going to answer the questions most technical first. That way you can...

WaitForInputIdle waits for any thread, which might not be the thread you care about

We saw last time that the function waits only once for a process to go input idle. Even if the process later stops processing messages, will return immediately and say, "Yeah, he's idle." The way a process is determined to be input idle is that it is waiting for user input when there is none. This translates into the process sitting in a function like or when there are no messages. But what if a process has more than one thread? And what if one of the threads is waiting for input, while the other is busy and unresponsive? The function will treat the process as having gone input idle, even if the ready thre...

WaitForInputIdle should really be called WaitForProcessStartupComplete

The function waits for a process to finish its initialization, which is determined when it reaches a state where it is just sitting around waiting for messages. The documentation for doesn't even get around to the initialization part until the Remarks section. If all you read is the one-sentence summary, Waits until the specified process is waiting for user input with no input pending, or until the time-out interval has elapsed, it would not be unreasonable for you to conclude that a process goes into and out of the input idle state each time it processes a message. But no, it's a one-time transition. If you ...

First, try reading the error message, episode 3: Even programmers see error messages without reading them

As we all know, users don't read error messages. And, sad to say, this behavior extends to the group of people you would think pay the most attention to error messages, namely, programmers, who are the people who cause your computer to display the error messages! Today's example comes from an internal programmer's tool which I will call Program Q. I'm trying to back out an update I made to record 19 of our table (which was entered as transaction 512), but I can't get it to work: What is the problem here, and how do I fix it? The transaction couldn't be backed out because somebody else made a chan...