The Old New Thing

Getting the location of the Close button in the title bar

Today's Little Program locates the × button in the corner of the window and, just to show that it found it, displays a balloon tip pointing at it. Let's start with the program from last week, the one that displays a balloon tip, then make these changes: Instead of positioning the balloon at the cursor position, we put it at the ...

Showing a balloon tip at a specific position, then removing it

Today's Little Program shows a balloon tip at a specific position, then manually removes it. Start with our scratch program and make these changes: When our main window is created, we also create a balloon-style tooltip and add a tracking tool. Normally, the tooltip control appears and disappears automatically, at a position of the ...

I thought you could use SWP_FRAMECHANGED to force a control to recalculate its properties after a change in styles

Simon Cooke dug back into his memory and asked, "Doesn't calling with cause a recreate and re-apply of the styles?" The flag does not recreate anything, but it does reapply the styles, as far as it knows. Recall that the bits in the window style break into two parts. There are the styles managed by the window manager, which are in the ...

How can I get information about the items in the Recycle Bin from script?

Today we'll do a scripting version of an old C++ program: Printing information about the items in the Recycle Bin. (How you wish to act on the information is up to you.) This is a pattern we've seen a lot. Bind to a folder, enumerate its contents, extract properties. Wow, that was way easier than doing it in C++! Just for fun, I'll ...

How can I get the Windows 8 touch keyboard to display autocomplete suggestions like the Bing app?

A customer observed that if you use the Windows 8 Bing app with the touch keyboard, the top of the touch keyboard includes autocomplete suggestions for quick access. They wanted to know how to enable this in their own application. In the illustration below, it's the two boxes immediately above the keyboard with the words "aol" and "amazon...

Enumerating subsets with binomial coefficients

Inspired by the Little Program which enumerates set partitions, I decided to do the binomial coefficients this week. In other words, today's Little Program generates all subsets of size k from a set of size n. As before, the key is to interpret a recurrence combinatorially. In general, when a recurrence is of the form A + B, it means that ...

Windows is not a Microsoft Visual C/C++ Run-Time delivery channel

There's a DLL in the system directory called , and from its name, you might think that it is the Microsoft Visual C/C++ Run-Time library. That is a perfectly reasonable guess. But it would also be wrong. The Microsoft Visual C/C++ Run-Time libraries go by names like or or or , and the debugging versions have a in there, too. And like...

Why does PrintWindow hate CS_PARENTDC? redux

Why does hate ? Because everybody hates ! Commenter kero claims that it's "easy to fix" the problem with and . You just remove the style temporarily, then do the normal , then restore the style. The question is then why simply doesn't do this. The question assumes that the described workaround actually works. It may work in limited ...