September 2005 - Posts

Window Clippings 1.0

Update: Version 2.0 is now available! Download it now from http://www.windowclippings.com/.

 

I’ve been sitting on this little application for about a month so I thought I better just put it out there for people to try.

I often write small applications or tools to save myself time and to make my time at the computer more productive. The Icon Browser, which I wrote years ago, is an example of one such tool that I wrote one night when I got sick and tired of scraping icon resources out of PE files using regular resource editors.

Window Clippings 1.0 was also born out of frustration. I often need to get an image of an application window for an article I may be writing. Doesn’t ‘Alt+PrtScn’ do that? Well yes and no. Alt+PrtScn creates an image of the window rectangle, but most people run Windows XP which supports themes that typically draw non-rectangular windows, known as window regions. Even if you’re using the Windows Classic theme, which defaults to rectangular windows, many applications today uses regions directly. Good examples include MSN Messenger and Windows Media Player.

Getting ‘clean’ images of these windows can be hard if the background does not match whatever color you will be rendering the image onto. Inevitably you need to position the window over a white background before pressing the PrtScn key. This is just a pain. To solve this problem and just generally make it far easier and simpler to create a ‘clipping’ of a window I wrote the Window Clippings application.

Before I talk about the application, let me quickly show you some sample results that you can compare.

Comparative Results

Here’s what you get when you Alt+PrtScn a typical Windows Explorer window:

Notice the top corners include the background color showing through. Here’s an example using OneNote’s ‘Create Screen Clippings’ feature. OneNote, if you haven’t tried it, is an awesome note-taking product:

Notice that the results aren’t exactly optimal for presentation if you didn’t ensure that the background color was set appropriately. This is actually a pretty typical result from screen capture products I’ve seen. Notice also that the focus is lost.

With Window Clippings you simply select the window you wish to capture and it will take care of creating an image with the desired background color, properly clipped to the window’s bounding rectangle:

You might also notice that the image created with Window Clippings shown here is a PNG file and is completely transparent outside of the window region (of course your browser may not be rendering alpha blended images correctly – this is a known problem in IE6) You can of course choose between BMP, JPEG and PNG formats. You can get even more dramatic results with applications like MSN Messenger (whose window region is quite a bit smaller than its rectangular window bounds).

Here is an example of an Alt+PrtScn of a Windows Media Player skin:

And here are the results of using Window Clippings. In this case I chose to produce a JPEG with a red background.

Using Window Clippings

Running Window Clippings is simple. Either run the MSI to do a proper installation of the product or simply download the EXE and run it directly from your local computer. If you install it using the setup wizard you can find the shortcut to the application in your Start menu. The only real advantage of using the MSI is that it will correctly remove the registry key, during un-installation, where the application stores your user preferences.

To create your first window clipping simply double-click the icon and select the desired window. You can also right-click the icon for more options.

When you create a window clipping you should notice your desktop appear to darken. Any window you click on will be highlighted. You can then double-click the window to perform the default actions (that are configurable) or right-click to perform a specific action. I encourage you to look through the options that are available.

Hopefully that’s enough information to get you inspired to try it. Here is a quick list of features you might be interested in:

Send window clippings to OneNote section of your choice
Copy window clippings to the Clipboard
Send window clippings to a history folder on disk
Specify background color for non-transparent images
Support for BMP, JPEG and PNG formats.
PNG and images sent to OneNote provide transparency
Support for multiple-monitor configurations

Other release notes:

Works on all editions of Windows XP (Home, Pro, Tablet, MCE) and Window Server 2003, including x64 editions.
Written completely in native code so nothing but the EXE is required.
Support for Windows 2000 may be provided based on demand.
All display monitors must be configured for 32-bit color quality to create window clippings. This does imply that, although Window Clippings runs in a Terminal Services session, you will not be able to create a window clipping since Terminal Services does not support 32-bit color. Support for lower color displays is being considered for a future release.

I hope you like it! I posted this at 1:30 AM so I hope at least some of this made sense...


© 2005 Kenny Kerr

Posted by KennyKerr with 13 comment(s)

The MVP Summit is Love

So this is my first MVP Summit and it sure is interesting. The theme seems to be that the VB folks are disgruntled. They seem to be feeling left behind. Everything from “VB6 or die” to case-insensitive programming. I hadn’t actually realized the latter was a “thing”. I just figured … well never mind.

Being under NDA has its limitations so let me put it this way: I can neither confirm nor deny that... we were all sitting in a talk given by Don Box when one of the VB MVPs starts bemoaning the fact that XML is case-sensitive and how that’s just too hard. Before I could blurt out some quip remark, Scott Hanselman pipes up: “So XML is hard – boo hoo”. As I said, I’m under NDA so I can neither confirm nor deny the unfolding of these events.

But we are all a loving family of MVP children and don’t like it when mommy and daddy fight (Sorry you had to be there to get it).

Anyway, I’m looking forward to meeting some more folk tomorrow. If you haven’t bumped into me yet, I’ll probably be with the developer security crowd tomorrow, but if there are any C++ MVPs or Microsofties you can always pull me aside for a good old chat about the most powerful language for writing managed code. Sorry folks, its case-sensitive.


© 2005 Kenny Kerr

Posted by KennyKerr with 3 comment(s)

Not about PureText

So PureText has been making the rounds on the blogs. It’s certainly a great little tool, but I thought I would point out something that all the bloggers seems to have overlooked. If you’re not a programmer you probably don’t care, but PureText comes to us from the creator of the Dependency Walker. If you’ve been programming Windows for five minutes (to paraphrase John Robbins) you have surely heard of “Depends”.

Steve Miller is the guy behind PureText, Dependency Walker and a number of other tools which you can find on his website.

Dependency Walker is an incredibly useful tool for examining the dependencies PE files (containing native code) have on other DLLs. Depends is also distributed with Visual Studio.

I just noticed that there is a 64-bit version of Depends. This is good news for me since I do all my work on Windows x64. Oddly the 64-bit version can only open 64-bit PE files while the 32-bit version can only open 32-bit PE files. It’s pretty simple to write code to support both formats. I’ve done it. Matt Pietrek has even written a cool article where he provides a neat solution for supporting both formats in a single build using C++ templates.

Anyway, Steve Miller rocks.


© 2005 Kenny Kerr

Posted by KennyKerr with no comments

MVP Global Summit 2005

See you all at the Summit. Be sure to say hi!

I’ll be there from Wednesday through Saturday.


© 2005 Kenny Kerr

Posted by KennyKerr with 3 comment(s)
More Posts