Re: Hosting windowless control

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



>>I'm not 100% sure what you mean by "windowless control". Do you mean
>>borderless? BTW you can implement non-rectangular windowed controls. See
Joe
>>Newcomers essay on this. Far better than any explanation I can give.
In my understanding, a windowless control is one which does not have its own
child window. Instead its OnDraw() method draws directly into the client
area of the host window. From my point of view, all I want to do is to
implement a non rectangular control. The problem is that the container
(Visual C++ dialog box) keeps blanking the control site to white before my
control's OnDraw() method gets called. Where do I find Joe Newcomer's
essay?

>>>I have discovered that when
>>> the host is a VB application it is, indeed, windowless (control's
bWndLess
>>> member = TRUE) but when hosted from MFC bWndLess is FALSE.
>>
>>But this bWndLess variable is just a variable invented by the control
>>writer. I mean it has no meaning to the OS. Can't you just set this
variable
>>in code?
The m_bWndLess member is invented by Visual C++ ATL control wizard. It is a
standard member of class CComControl and is documented in MSDN and I quote:

<QUOTE>
Remarks

Flag indicating the control is windowless.

The data member m_spInPlaceSite points to
anIOleInPlaceSite,IOleInPlaceSiteEx, orIOleInPlaceSiteWindowless interface,
depending on the value of the m_bWndless and m_bInPlaceSiteEx flags. (The
data member m_bNegotiatedWnd must be TRUE for the m_spInPlaceSite pointer to
be valid.)

If m_bWndless is TRUE, m_spInPlaceSite is an IOleInPlaceSiteWindowless
interface pointer. See m_spInPlaceSite for a table showing the complete
relationship between these data members.
<<END QUOTE>

Most of this is gobbledy-gook to me but I get the impression that even I
could set it in code, I doubt that it would do much good. I think its
purpose is to convey information to me rather than actually _do_ anything.

>>> What happens is that MFC blanks the rectangular area of the control site
>>>to white before invoking the control's draw function.
>>
>>I think this is called erasing the background, which I believe can be
either
>>done or not done based on programmer preference.
I'm not sure where, as the programmer, I get to vote. I know that if I
explicitly call InvalidateRect() I can specify whether to blank first (and,
incidentally, I have never yet written a program where I _do_ choose to
blank the area, which makes me wonder why that's the default action; but
that's another matter). However, this is on an implicit redraw. Eg. after
covering then uncovering the window.

Regards
Keith






.



Relevant Pages

  • Re: Windowless Control (Flash Object)
    ... the popular solutions, like ATL and WinForms, would create a window to host the ActiveX control in the whole, and the control can be as much windowless as it wishes, but still it will sit inside a window on the form. ... If you need badly to work it around, you could write a piece of ActiveX hosting of your own, which is not a hard task, but as a prerequisite it requires some deep ActiveX knowledge so that to make it work consistently. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Hosting windowless control
    ... I'm not 100% sure what you mean by "windowless control". ... > the host is a VB application it is, indeed, windowless (control's bWndLess ... > What happens is that MFC blanks the rectangular area of the control site ...
    (microsoft.public.vc.mfc)
  • Re: Strange stuff
    ... The only control item is the MSCOMCTL.OCX. ... Windowless Controls in the Mswless.ocx File Are Not Supported ... "Jim Carlock" wrote in message ... > Post replies to the newsgroup. ...
    (microsoft.public.vb.general.discussion)
  • Re: how to create a ATL window in a thread ?
    ... > I wrote a ActiveX with ATL that hosts a windowless control. ... > This windowless control is Flash player. ... > If multiple instances in InternetExplorer works, why not in a ATL ...
    (microsoft.public.vc.language)
  • Re: Validation and Undo
    ... | But, as the user edits a field, the control itself offers a Validation ... which is hinting at a Transaction at the control level. ... The edit is a means of entering data that will be passed to the underlhying ... interrupt the flow of data to the data member and prompt the edit to refresh ...
    (microsoft.public.dotnet.languages.csharp)