Originally, I would like to submit the code and e-text articles to CodeProject and write. I don't know why. These two days CodeProject submit a question, and I will start writing the principle first. Anyway, I am afraid I have to write a few days.
Foreword
Hey, it is estimated that it can't write today, just call the foreword. Next, the next time, say Skin technology, everyone will not be strange, you can contact this thing, may be Winamp, you can flexibly replace the interface style, very fancy. Later, using Skin software is more and more, after all, it is still important to make a beautiful interface. Although the Windows standard interface is also more fantastic, but you can't meet the appetite of people. There is a special gorgeous interface that is always worthy of boast, see MSN Explorer, Media Player, Realone ... There are many ways to achieve this customized, and early SKIN technology requires a lot of procedures themselves. Basically, they are posted on the interface, and then obtain different visual effects by replacing the image, like WinAmp. This method is actually very flexible, and any effect you want, the disadvantage is that the encoding is too much trouble.
With the more and more software that wants to have their own specific SKIN, there is a special SKIN plug-in. This is more famous is Windowblinds and ActiveSkin. I know and have used these two, I don't know if it is the most famous. These products are generally providing a COM component that requires SKIN support to create this COM component, and then call several methods, you can make your own procedure completely change, or even dynamically change the appearance at runtime. Such component packages are very convenient, and no programmer has any understanding of Skin technology. Disadvantages, mainly to charge, of course, we can use crack version, I originally used the Windowblinds component that our company took a big crack version of the night. The charging is only one aspect, and the labor results of others should be given, and the real problem is that it is often not satisfied. In order to get 100% of the SKIN that meets yourself, you can only write it yourself.
From today, I will talk about how to write such a SKIN plugin. In 2002, a plug-in was written, and the original purpose was to simulate the effect of Mac on the PC. At first, use WindowBlinds components, you can't always be satisfactory, and finally say it, you will start writing. It took more than a month to probably, it has been written, and later, due to business reasons, the project is canceled, and it is white. Of course, there is no white dry thing for the skilled person, and the salary has not been raised, and the technology is improved.
In the first two days, someone asked me about the problem of hooks, and suddenly remembered this thing written in the previous year (the previous year! How to live, old). Look at the original code is still, and this thing is designed, I am proud of myself, and now look at it, it is really good. Instead of letting it lying on the hard drive, it is better to take it out to dry, and maybe it is helpful to help the students. If you are interested, you will get an OpenSource project to continue writing is also good.
Design goals
The foreword is almost, and the design goals are written below. This thing is the most important design goal is to use convenience. Existing programs create a COM object, tune a method to change all the appearance of the interface to the MAC style. Another goal is to be scalable, because in addition, there is a need to simulate the demand for Windows XP interface on Windows 98, and you can simulate other systems. Therefore, basic design is to define a unified interface and then do different implementations. Each implementation is made separately in a COM DLL, the caller selects a CLSID to create an object. Simply put the definition of the interface, INTERFACE ISKINX: IUNKNOWN
{
[Helpstring ("Install Skin Hook"] HRESULT Installskin ([In] long lthreadid;
[Helpstring ("Uninstall Skin Hook"] HRESULT Uninstallskin ();
}
Call installskin Install Skin, Uninstallskin Remove Skin, LTHREADID is a thread ID, which will be explained later. I am here today, I finally posted a few pictures, see the effect first