text: Back in August 2007, I promised to post a program the following day but it appears that I never did. Oops. I discovered this as I went through my "things to blog about" pile and figured better late than never. Though five years late is pretty bad.
  Here's a program which fills a combo box with some strings.
  #include <windows.h> #include <windowsx.h> static LPCTSTR rgpszList[] = { TEXT("Austria"), TEXT("Belgium"), TEXT("Bulgaria"), TEXT("Cyprus"), TEXT("Czech Republic"), TEXT("Denmark"), TEXT("Estonia"), TEXT("Finland"), TEXT("France"), TEXT("Germany"), TEXT("Greece"), TEXT("Hungary"), TEXT("Ireland"), TEXT("Italy"), TEXT("Latvia"), TEXT("Lithuania"), TEXT("Luxembourg"), TEXT("Malta"), TEXT("Netherlands"), TEXT("Poland"), TEXT("Portugal"), TEXT("Romania"), TEXT("Slovakia"), TEXT("Slovenia"), TEXT("Spain"), TEXT("Sweden"), TEXT("United Kingdom"), }; INT_PTR CALLBACK DlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_INITDIALOG: for (int i = 0; i < ARRAYSIZE(rgpszList); i++) { SendDlgItemMessage(hdlg, 100, CB_ADDSTRING, 0, (LPARAM)rgpszList[i]); } return TRUE; case WM_COMMAND: if (GET_WM_COMMAND_ID(wParam, lParam) == IDCANCEL) { EndDialog(hdlg, 0); } break; } return FALSE; } int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR lpCmdLine, int nShowCmd) { DialogBox(hinst, MAKEINTRESOURCE(1), NULL, DlgProc); return 0; } // scratch.rc #include <windows.h> 1 DIALOG 50, 50, 185, 98 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_DLGFRAME | WS_SYSMENU BEGIN COMBOBOX 100,7,40,150,300,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL END
  Run this program and start typing: "S"-"L"-"O"-"V"-"E"... Hey, look, the combo box is performing incremental search and once you hit the "E", it selected Slovenia, the first item in the list which begins with the letters S-L-O-V-E.
  Wait a few seconds, and try it again. This time, type "S"-"P", and hey look, it selected Spain. You didn't have to go through all those other "S" countries to get to it.
  If you hit F4 to open the combo box and then type "S"-"L"-"O"-"V"-"E", observe that there is a tiny vertical line that tells you where you are in the incremental search string.
  As I noted some time ago, the incremental search resets after four times the double-click time, or two seconds by default.
  Note: The "things to blog about" pile has over 2000 items in it, so there really isn't much need for a Suggestion Box, but I open it up once every few years just for show.
  You didn't forget, you pulled it:
  blogs.msdn.com/…/4580767.aspx
  Well, good to know that we'll still have blogs to read through 2020 some time, and that's not including all the new topics that come up in the next 7 years.
  Interesting. For some reason the .NET combo box, which seems to be a simple wrapper around the Win32 combo box didn't have the behavior, and I went way out of may way to add it.
  As it happened, my behavior was better than this behavior anyway, so I'm not interested in trying to hunt it down.
  [The "things to blog about" pile has over 2000 items in it…] Wow long queue.
  [I open it up once every few years just for show.] Sure helps your popularity. Personally I wouldn't have minded seeing a stack of quick/short answers to a bunch of items in the suggestion box again either (you did that once).
  [or reddit/AMA]
  Speaking of which I'd be fascinated to see you do one! I'd also be interested to see what your future conference speaking engagements are and make an effort to try and see you in person. I'd love to get my copy of 'The Old New Thing' signed by the one and only Raymond Chen.
  I always wonder if the "Time zone" combo box could have been better designed for incremental searching.
  Slove is all you need? :D
  It's too bad that Raymond doesn't "star" comments anymore, because Chriso deserves a star.
  Off-topic: Seconding the request that Raymond do a Reddit AMA.
  "I'd love to get my copy of 'The Old New Thing' signed by the one and only Raymond Chen."
  I'm sure Raymond would also love to meet the guy he owes his royalty check to. :)
  A Reddit AMA for Raymond Chen would be pointless because, as has been demonstrated on this blog, he would not be willing to answer certain questions. Can't say I blame him, really. Nobody wants to get a chair thrown at them. Perhaps after Mr. Chen retires.
  "he would not be willing to answer certain questions."
  Backbone is a good thing.
  Key to this functionality is the CBS_SORT style.
  Reddit has a massive anti-corporate and anti-Microsoft bias. Having a Microsoft employee like Raymond do an AMA would, to use one of Reddit's favorite memes, effectively be saying "You're gonna have a bad time."
  Now that you've mentioned the size of your backlog, I'm going to be completely inappropriate and post a question in this comment thread that has bugged me for years:
  After opening up the window menu (Alt+Space, or clicking the icon at top-left) and selecting Move, you can not use the mouse to move the window. Moving the mouse moves the cursor around, but not the window. However, if you hit an arrow key, the mouse snaps to the window, and moving the mouse moves the window around.
  Why doesn't the mouse start moving the window around as soon as you go into "move mode"? Why do you have to hit an arrow key first?
  I've been really curious about the details/history of this behavior for as long as I can remember observing it in Windows, which if memory serves, has been at least a decade and a half.
  @TehShrike: I'm absolutely sure that the move on the context menu exists for the sole purpose of keyboard accessibility. Evey Raymond wasn't there when the decision was made so long ago but he might be able to confirm.
  It may have been too tiny to see, but I couldn't discern a vertical line.
  @Joshua: What do you mean by "Backbone is a good thing"?
  I've tried to set the CBS_SORT style dynamically, according to the need for auto-completion. However, I found out the hard way that setting the CBS_SORT style after the combo box is created doesn't actually tell the control to start doing auto-completion, even after clearing the contents and adding new strings.
  I wish there was a list of what styles are meaningful only at creation time.
  It means it's good to be principled even when it's unpopular. Metaphorically, having a spine to stand on your own rather than relying on others to hold you up.
  @John: I know what the expression means. What I meant was how it related to my statement? I would love to ask about internal design decisions, office politics, opinions, etc, but obviously he's not going to answer those types of questions (at least not on a public forum).
  @TehShrike
  Probably because the taskbar defaults to the bottom of the screen. So two scenarios:
  1) You want to move using the mouse – so therefore the default position of a window when initiating a move is hanging off the bottom of the screen. Doesn't sound good.
  1) You want to move using the keyboard – "Aaaargh! Where did my window move to? Oh great it's all the way over there. I'm using my keyboard to move it, why did it snap across 3 screens to where my mouse is?"
  @Ray: except that this behaviour hasn't changed at least since Windows 3.1, where there was no multimonitor support.