principle
The last time is basically introduced, that is, nonsense, telling today to achieve the basic principle of Skin. To achieve your own unique interface, there are a lot of ways. I also said last time. Here is only one, that is, change the appearance of the existing control through the message hook. The advantage of this method is that you don't have to modify the standard interface that has been completed, just hang the hook function, all interfaces have changed, which is very convenient to use. The basic principle here is the following call: Setwindowshookex (wh_callwndproc, hookproc, 0, lthreadid); WH_CallWndProc hook can intercept window messages within the thread of LThreadID, so we have the opportunity to handle these messages. However, the light-cut message is still not enough, we must also know who these messages are issued, the same news sent by Button and Editbox must have different processing. Fortunately, in the parameters of the message we can get the window handle, and we can get the window class through the window handle. The window class here is not a class of C , but the window class name in the Windows system. For example, the window class of the button is "Button", the window class of the combo box is "ComboBox" ... These can be found in MSDN, in addition, there are some window class names, such as dialogs, etc. There is a class name called "# 32770", and the menu is actually a window, and its class name is "# 32768". Interesting, with this information, we can distinguish between different windows. As for what news is handled, it is obvious that the most important thing is the WM_PAINT message. This allows us to overload the system default drawing method, and draw the control window into what we want. However, only the WM_PAINT message is also not enough, because the style of the control is not a constant, look at the Windows XP display effect, with the button as an example, there are many style, ordinary style, the mouse on the button, the mouse hold down the button style The mouse holds down the button and moves to the button out of the button ... In order to realize dynamic glad Skin effect, we also need to intercept some other messages, such as mouse messages. There is an implementation of the Mac button in the downloaded code, look at it. The principle is so much, it seems that it is not very complicated, but I know the principle and the code that can write actual work, still has a big difference. There is also a very critical design and code, these, stay waiting for the next time, today, I will come here, I will post it again.