Sometime ago I incorporated VFPSkin elements into a project I was working on. This was when VFPSkin had first come out (version 1.0?) and was still free and open source. I was pretty impressed with VFPSkin as I had never seen skinning for Visual FoxPro applications prior to this. It was a little buggy and I made a lot of modifications, but overall the idea was sound and ingenious. (Just for the record, I made it a point not to look at VFPSkin's source code while I created the example for this blog entry. I admit having been exposed to VFPSkin and thus influenced by it, but the code and parts of this example were created from scratch.)
So, that was extent of my exposure to skins in Visual FoxPro... fast forward to today. I decided to take a look at creating a simplified way to skin Visual FoxPro screens. Why? Well, as with most of my ideas and side projects, sometimes it's the challenge and other times I just have an idea for something that might be helpful to the Visual FoxPro Community and I want to explore it a little. In this case, as in most, it was a little of both. I call this project "Green Screen".
The idea was to take a single ordinary bitmap that has a unique background color (transparency key if you will), use it for the picture property of a form, and then carve out everything at runtime based on that unique color. In this case I chose green for the color -- just like in the movies (that's where I got the idea, though these days I think Hollywood uses mostly blue) -- and I created a simple sample skin that I could use during development.

Green Screen Skin Bmp
Using some API calls (CreateRectRgn and CombineRgn in GDI32 and SetWindowRgn in USER32) the project quickly progressed and I soon had a form that displayed just the intended portion of the bitmap skin. Next it was time to create a routine that would allow Visual FoxPro developers to use their own bitmaps and create "skin definition files" based on them. I decided to incorporate this portion into my example form as well.
This is just a quick initial stab at it... consider it a pretty decent proof of concept. My ultimate goal for this portion was to show Visual FoxPro developers how skinning can be accomplished in a simple, straightforward way. It took much less than a day to get this far, so imagine what can be done given time. Next up on my todo list will be the ability to resize the form (as well as maximize and minimize) and also the ability to skin/unskin on demand as well as the ability to change skins on the fly. I will be keeping an eye towards simplicity throughout, as I want this to be a very painless tool for Visual FoxPro developers to use.
A couple of quick final notes: The two methods in the example form that you'll want to take a look at are createskindefinition and readskindefinition. Though I chose green as the unique color, it can be anything. The readskindefinition method will look at a single pixel in the bottom left of your bitmap to determine the color that should be carved out of the form. All in all, I think you might be surprised at minimal amount of code it took to actually pull this off. Here's a screen shot of the example and the customary download link.
Download Green Screen Example (10 KB approx.)