Wednesday, January 25, 2012

Copy error messages to clipboard

I wouldn't believe it if I hadn't just tested it. In the (should be) immortal words of the poster "From Windows 2k onwards you have been able to copy the text in error messages to the Windows Clipboard by pressing Ctrl + C, but Microsoft forgot to tell anyone."

Yes, it's true. I tested with an error message from my own code:

When that popup has focus, if you Ctrl+C, then Ctrl+V into a text window, you get:

---------------------------
AutoKeys.au3: HlprMkREWinActive
---------------------------
Unable to set The Raiser's Edge as active.
---------------------------
OK
---------------------------

I haven't checked to see if it works with all MsgBox( ) type things, but it probably does.

Oh--also it turns out Windows NTFS since maybe NT 3.0 does support something like the Unix symlink. (Symlinks are different than .lnk files because, for most purposes, they are treated as a real file or folder. It allows for one file or folder to appear to exist in multiple names and/or locations within the filesystem without crufty wasteful copying.) In NTFS, they're called Junctions, and they only work for folders. (Apparently, in Vista, MS added some new feature that finally allows for full symlinks.) Google for 'sysinternals junction.exe'. Be very careful with them though--since they're transparent to most all the programs on the OS (i.e. treated as actual folders), it's easy for a lot of accidental damage to happen.

--
Furry cows moo and decompress.