First, we sometimes want to do their own control is translucent or transparent, like a translucent form, I after a period of time query, found that this is achievable, we look at its implementation and bring some problems. First: You need windowless support when making controls, which means that the control does not need a window. If the control has a window, then we need to deal with a lot of trouble with the window drawing. window, if we do not have to draw the part of Microsoft's people for us to think of, they dealt with, but the treatment is very unsatisfactory, we can experiment, is simply very ... And our window must be rectangular, it can't be the other shape.
Second: We need to set up the controls placed in IE, we need to add Filter:alpha (opacity=80) to the style of the object tag, and he means to tell ie how transparent our controls are. Please see test.html for details. And this requires a higher version of IE support.
Second, the relevant code, from this function, you can also choose to create a window without Windows support, thought will add code:
DWORD CTestCtrl::GetControlFlags()
{
DWORD dwFlags = COleControl::GetControlFlags();
// The control can activate without creating a window.
// TODO: when writing the control''s message handlers, avoid using
// the m_hWnd member variable without first checking that its
// value is non-NULL.
dwFlags |= windowlessActivate;
return dwFlags;
}
Three, the following is to think of pictures and programs run pictures, for reference only:
Figure One wizard picture
Figure II Program run results
After compiling the program, it will register the control and open the test.html to see the result. What you need to know is that the control is windowless, so it's troublesome to handle the window, such as a point control that wants to have a menu, this implementation is problematic, and the capture of the message is not very good. I used a roundabout way to solve the problem, if the master can directly solve the problem, please tell me, thank you in the first place. The realization of this technology also thanks to the friends who have helped me on the vckbase.
This article supporting source code