in

ASP.NET Weblogs

ChuckOp's eXPeriences

Commentary on software design, development and management - plus much more.

Copy message box text to the clipboard

Ever get a error message and need to write it down?  Particular one with an obscure error number like 0x80040e09?  Starting with Windows 2000, you can copy the entire contents of a message box to the clipboard by pressing CTRL+C.

Software developers often put error messages into a “message box.”  A message box is a type of dialog box managed by Windows.  It's very easy to implement from a programming standpoint, and thus many error messages are shown this way.

Users see message boxes all the time.  They are the ones with a either a icon to the left and some text.  There will be buttons, like OK, Cancel, Yes, No, etc.

To see a message box in action, go to the Start menu and choose “Run...“  Then type in something that doesn't exist, such as “foobar“ and press Enter (or click OK if you really like moving your hands back and forth from the keyboard to the mouse).

You'll get a message box dialog that says “Windows cannot find 'foobar'.“ and a lot more information that I didn't want to bother to type in manually.

Since the text is presented in a static text box, there is no way to select all or a portion of the text.  Another method would be to use the edit text box control, and set the text to read-only.  That's what the Windows shell does for the file property sheets, which allows users to select and copy text such as the full pathname of a file.

In Windows 2000 however, a shortcut was added to the message box code to look for the copy operation.  So, if you press CTRL+C, the text of the message will be copied to the clipboard.  If you paste it into notepad, it'll look like this:

---------------------------
foobar
---------------------------
Windows cannot find 'foobar'. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search.
---------------------------
OK  
---------------------------

I seem to remember this feature being talked about in 1998 as a benefit to accessibility, and it is.  I don't think the feature was added solely for accessibility purposes however.

Now, this only works for message boxes.  Many dialog boxes are shown by applications.  Those are generated and handled by the application.  Only when an application asks Windows to display a message box will this shortcut work.  For example, Microsoft Word displays dialogs that appear like message boxes, but they are not.  Actually, they aren't the dreaded Standard Dialog Manager (SDM) type of dialogs either, so Word is all screwed up.

Published Apr 08 2004, 05:53 PM by ChuckOp
Filed under: , ,

Comments

 

AT said:

;o) I had a bug report filled on this during Windows NT 5 (aka 2000) beta
April 9, 2004 12:48 AM
 

error1143 said:

Mark this day... Thursday, April 08, 2004 5:53 PM
Chuck said.... "Word is all screwed up". :-)
April 9, 2004 3:47 PM
 

Prasad Dange said:

This is a great help to me

Thanks
Prasad
June 23, 2004 10:01 AM
 

oou said:

thanks it' so good
July 13, 2004 11:20 PM
 

aaron said:

Or you could, ya know, take a screen shot...

June 13, 2007 5:59 PM
 

» Windows Tip: Copy error messages text to the clipboard said:

Pingback from  » Windows Tip: Copy error messages text to the clipboard

June 13, 2007 6:01 PM
 

Techzi » Blog Archive » Windows Tip: Copy error messages text to the clipboard said:

Pingback from  Techzi  » Blog Archive   » Windows Tip: Copy error messages text to the clipboard

June 13, 2007 6:13 PM
 

gaxxa said:

mmm, aaron, if you know some way of using the 'text' in a screen shot to do a Google search please let me know ....

June 13, 2007 6:47 PM
 

cybertyrant said:

Gee.e..... Thanks..... This is so-so-so useful

June 13, 2007 7:21 PM
 

Aaron said:

gaxxa:

step one: screen shot error message

step two: google.com

step three: look at screenshot and enter keywords

you don't need the ENTIRE message for a Google search. It's robust enough to only require keywords. That's the whole point, but I guess Windows is all about doing things the hard way :)

June 13, 2007 8:05 PM
 

Il Liceo » Blog Archive » Windows Tip: Copy error messages text to the clipboard said:

Pingback from  Il Liceo  » Blog Archive   » Windows Tip: Copy error messages text to the clipboard

June 13, 2007 8:12 PM
 

Copy message box text to the clipboard « Red Chaos’ PC Tech & Gaming said:

Pingback from  Copy message box text to the clipboard « Red Chaos’ PC Tech & Gaming

June 13, 2007 9:04 PM
 

gs said:

Aaron, a pen and a piece of paper is just as convoluted as your suggestion. CTRL+C saves you two steps and the headache.

June 13, 2007 9:05 PM
 

Copiar los mensajes de error en el portapapeles @ bloglsia said:

Pingback from  Copiar los mensajes de error en el portapapeles @ bloglsia

June 13, 2007 9:26 PM
 

chiefbutz said:

And why didn't MS tell us about this? Oh wait, that is a no brainer, they wanted to make us SUFFER!

June 13, 2007 10:10 PM
 

Ctrl-C Your Error Messages at The Open Source Ministry Blog said:

Pingback from  Ctrl-C Your Error Messages at  The Open Source Ministry Blog

June 13, 2007 11:54 PM
 

William Furr said:

Wow.  Such a useful feature, but I had no idea.  Seven years after release, it finally percolates it's way to me.  Huh.

June 14, 2007 12:05 AM
 

Control+C works on error messages « notastute said:

Pingback from  Control+C works on error messages « notastute

June 14, 2007 12:23 AM
 

IT Masala » Blog Archive » Copy error messages text to the clipboard said:

Pingback from  IT Masala  » Blog Archive   » Copy error messages text to the clipboard

June 14, 2007 12:25 AM
 

Jitendra Bangani said:

This is a very useful tip...

Thanks...

June 14, 2007 1:47 AM
 

Windows Fehlermeldung in Zwischenablage kopieren | .:. stoeps .:. de .:. said:

Pingback from  Windows Fehlermeldung in Zwischenablage kopieren | .:. stoeps .:. de .:.

June 14, 2007 2:45 AM
 

zeroat.net » Wie kann ich den Text aus einer Windows Fehlermeldung in die Zwischenablage kopieren? said:

Pingback from  zeroat.net » Wie kann ich den Text aus einer Windows Fehlermeldung in die Zwischenablage kopieren?

June 14, 2007 3:14 AM
 

zeroat.net » Wie kann ich den Text von Windows Fehlermeldungen in die Zwischenablage kopieren? said:

Pingback from  zeroat.net » Wie kann ich den Text von Windows Fehlermeldungen in die Zwischenablage kopieren?

June 14, 2007 4:24 AM
 

chriso said:

Ay carumba! I can't believe that this isn't more widely known!  So many times I despair of those stupid un-selectable error message boxes.

Thanks!

June 14, 2007 4:48 AM
 

Chris Mikaitis said:

I'm too lazy to check if this has been said, but 'CTRL+Print-Screen (or CTRL+SHIFT+Print-Screen... one does entire screen, one does active window) copies a shot of the entire screen to the clipboard.  Also very useful.

June 14, 2007 6:32 AM
 

Tan said:

Aaron: you're either kidding, or you've never used windows at all.

June 14, 2007 7:47 AM
 

Koushik said:

Thanks, this is very useful and rare info. Really saves time on those awfully obstruse error boxes you see - even if you want to file a bog on the app that thew it, it is far easier to communicate the text rather than a screenshot.

I stumbled on an example to demonstrate this with fewer steps, though.

Open notepad and type some junk, when u close notepad, it displays a message box asking if you want to save the file... Ctrl+C and paste it into notepad (after disposing of the message box with No/Cancel, of course) and voila...

June 14, 2007 3:07 PM
 

Cernansky said:

Screen shots are wasteful. Tech support is part of my job and our databse gets reams of screen shot bitmaps ranging in size up to 5 MB just so the users can send us a 15 word dialog box message without typing for a few seconds.

Thanks ChuckOp!

June 14, 2007 3:28 PM
 

Ab’s Blog » Blog Archive » Copy Windows Error Messages said:

Pingback from  Ab’s Blog  » Blog Archive   » Copy Windows Error Messages

June 14, 2007 6:36 PM
 

sean said:

Great tip! Thanks :)

June 14, 2007 7:15 PM
 

ankh said:

why screenshot when you can have it paste into a text file or directly into google?

with screenshot you still have the same steps as copy and paste but with this at least you don't have to type out the words from the screenshot into a web browser. if it cuts down an extra step why not?

June 14, 2007 10:12 PM
 

Bilal Ak?ay Weblog » Mesaj kutusundaki yaz?y? kopyalamak said:

Pingback from  Bilal Ak?ay Weblog » Mesaj kutusundaki yaz?y? kopyalamak

June 15, 2007 2:56 AM
 

Copy error Messages Text to the Clipboard at Brian’s Blog said:

Pingback from  Copy error Messages Text to the Clipboard at  Brian’s Blog

June 16, 2007 12:30 PM
 

Matt Ireland said:

Dude! That's so cool!

June 16, 2007 3:03 PM
 

??leti Kutusu Metnini Pano Defterine T??pk??lamak « Labora Turcica said:

Pingback from  ??leti Kutusu Metnini Pano Defterine T??pk??lamak « Labora Turcica

June 18, 2007 8:04 AM
 

Neil Halloran said:

I have always hit print screen and open word and paste it

June 18, 2007 3:35 PM
 

Stephen said:

I much prefer screenshots because they often let you see where the user was when when the error message appeared.

June 19, 2007 4:31 AM
 

Mike said:

Utterly brilliant!

Why hasn't this come up before?

June 19, 2007 2:28 PM
 

Linkdump « Second Hand Gedanken said:

Pingback from  Linkdump « Second Hand Gedanken

June 25, 2007 3:32 PM
 

?????? ????????????.NET » ???????????? #313 said:

Pingback from  ?????? ????????????.NET  » ???????????? #313

July 4, 2007 5:00 AM
 

Hottie said:

Hey- who wants 2 b mine

August 10, 2007 3:38 PM
 

I am just a programmer » Blog Archive » Copy Error Message Box Text Directly to the Clipboard said:

Pingback from  I am just a programmer  » Blog Archive   » Copy Error Message Box Text Directly to the Clipboard

October 29, 2007 12:31 PM
 

Womens Discount Perfume » Not perfume online but still interesting… said:

Pingback from  Womens Discount Perfume » Not perfume online but still interesting…

October 30, 2007 4:06 PM
 

Womens Discount Perfume » Not discount perfume but still interesting… said:

Pingback from  Womens Discount Perfume » Not discount perfume but still interesting…

October 31, 2007 7:56 AM
 

3 Time-Saving Ways to Deal with Computer Errors said:

Pingback from  3 Time-Saving Ways to Deal with Computer Errors

November 19, 2007 7:00 AM
 

David Rogers said:

Awesome functionality. Thanks!

December 20, 2007 1:59 PM
 

fojie said:

Great help.. Thanks! :-)

February 14, 2008 12:30 PM
 

How to Copy Error Message text to Clipboard - The Winhelponline.com Blog said:

Pingback from  How to Copy Error Message text to Clipboard - The Winhelponline.com Blog

April 12, 2008 3:58 AM

Leave a Comment

(required)  
(optional)
(required)  
Add