Some instructions about translucent and transparent controls in IE

Source: Internet
Author: User
Tags windows support

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.