If you can’t remember the exact text of a dialog box (so you can search for it), you can ask the Internet

Some time ago, I noted that If you're looking for the code that displays a particular dialog box, the most directly way to find it is to look for the dialog box. That works if you have a screen shot of the dialog box. But what if you don't?

A colleague of mine wanted to find the code that displays the "Your password is going to expire soon" notification, but he didn't know what string to look for. It so happened that he asked me four hours too late, because my password happened to have expired that morning, but by the time he asked me for the text of the message, I had already changed my password.

Think out of the box: You know who probably has a screen shot of the "your password is going to expire soon" notification? Somebody on the Internet.

A Web image search quickly turned up the exact text.

Comments (27)
  1. Brian_EE says:

    "A Web image search quickly turned up the exact text." – Maybe that link worked when you wrote the article, but now, 4 of the 6 returned images are "how to cancel your Apple subscription". 1 is for software to protect children while they use the internet, and the last is an image of a news article.

    I think the search term is no longer specific enough.

  2. Brian says:

    One little know feature of Windows:

    On plain vanilla dialog boxes in recent versions of Windows, if you press <ctrl>+C while the dialog is displayed, the text of the dialog (including caption, buttons, everything) will be written to the clipboard as text.  It doesn't always work, but it often does (sometimes you will get an error <beep>, but you can just ignore that).

  3. Dan Bugglin says:

    @Brian_EE Google results are tailored for individual users. Bing might do something similar.

    @Brian Works on XP and up IIRC for standard message boxes.

  4. Antonio &#39;Grijan&#39; says:

    @Brian: I didn't know that. Thanks a lot for the tip! Now I can write down those pesky 0x8… automation error codes without risking a typo. Now, that's a handy feature I should add to my custom MessageBox/MessageBoxEx substitute.

  5. SimonRev says:

    Something feels off about the Bing results for that specific search term.  Only 6 results.  Also the suggested alternatives at the top weren't any better — with the one for XP returning nothing at all.

    On the other hand, another leading search engine turns up piles of results with the one you want as the first result and the next dozen or so being pretty close.

  6. Dango says:

    @Antonio Grijan: The obvious solution is to use a text control (which allows to select text) rather than static text.

  7. Max says:

    @Brian_EE: The search works fine for me. Are you sure you didn't click the wrong tab in your browser or something? It'd be rather odd for Apple subscription screenshots to come up for "windows password expiration".

  8. DWalker says:

    @Brian:  Doesn't work for me, testing (Windows 7 Pro) on the dialog box "Are you sure you want to move this shortcut to the Recycle bin?"  Maybe it works for some dialogs, but that one should be "plain vanilla".

  9. DWalker says:

    @Brian I meant to say… of course, PrtScrn copies the entire screen, and you can paste to Paint or something fancier (but Paint is always available).

  10. SimonRev says:

    @Max — the Bing search work fine now.  Earlier this morning though the results were very odd.  I saw the same ones Brian_EE saw

  11. SimonRev says:

    Actually if you click the link in Raymond's post, then you can still see some oddness.  Near the top of the page for me there are suggestions for "Windows 8 Password Expiration" and "XP Password Expiration Notification"  Both of those turn up unusual results (especially the Windows 8 one)

  12. Brian_EE says:

    That's interesting. The search link now has relevant results. At least I know it wasn't just me (SimonRev). Wish I had captured a screen shot.

    According to browser history, the link now and earlier are the same.

    Maybe the person who filters the results when you click search hadn't had their cup of coffee yet this morning. After all it was only 7am in Redmond.

    @Max – Hard to click the wrong tab – only one open and clicking the link opened the search in the current tab.

  13. alegr1 says:


    > the Bing search work fine now

    I remember there's been allegations once that Bing is scraping search results from the other search engine.

  14. alegr1 says:


    >On plain vanilla dialog boxes in recent versions of Windows

    For value of "recent" at least 15 years old.

  15. Cole says:

    It's a shame an otherwise entertaining blog post was ruined by linking to Bing instead of Google.

  16. 640k says:

    @Brian & The MAZZTer

    Ctrl+C has always been awailable in the MessageBpx() in NT, since last millennium.

  17. Henri Hein says:

    Since we seem to be counting, the image search link worked well for me.

    If the image search didn't work, you can always go straight to Youtube and look.  There seem to be how-to's for every basic task.

  18. Joe says:


    Bing pays you to use it. Google doesn't.

  19. Joshua says:

    @Cole: It's no shame if a Microsoft employee's blog hosted by Microsoft reference bing for search.

  20. SD says:

    Always surprising how people freak out over Bing. Gosh it's crazy, it's like someone working at Google wouldn't link to Yahoo in their blog.

  21. Boris says:

    @Cole: but this is just like the horror of stdio or the occassional diæresis. One reason why (de facto) standards exist is to avoid drawing attention away from the topic at hand, but why spoil the fun, especially in an informal setting such as this blog?

  22. b says:

    I only noticed the image search page to be Bing instead of Google only after reading your comments. Interesting..

  23. Boris says:

    Of course, if Raymond had linked to the search engine which cannot be named, it would've drawn attention in another way. Isn't it possible to create a politically correct hyperlink that would use the browser's default search provider? :)

  24. Kevin says:

    @Boris: Nope, we discussed this a couple of weeks ago.


  25. let me bing that for you says:

    90% of all referrers to bing come from blogs.msdn.com/…/oldnewthing


  26. Max says:

    @Kevin: That was for launching the default search provider from OUTSIDE the browser, from something such as the command line, and doesn't really apply to invoking search from within HTML. The problem is that "default search provider" isn't something that exists in HTML or any other web standard – it's a proprietary feature implemented independently by every major browser developer, without any collaboration or information-sharing between them. Neither HTML nor Javascript has any concept of a "default search provider" or the ability to perform a "default search", and browser makers have not cooperated to create a common programmatic interface for interacting with search from within the HTML document.

  27. Cole says:

    Regardless of who the blogger's employer may be, I can't help but feel that linking to search engines other than Google is insulting the reader's intelligence.

Comments are closed.

Skip to main content