How to get a pointer to parent window using windowlessActivate

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jurgro
    New Member
    • Jul 2007
    • 1

    How to get a pointer to parent window using windowlessActivate

    Hello.
    I am developing an Activex control to show animated gif and other images. With windowlessActiv ate flag the control is transparent. I want to show animated gif in a thread.
    Now the problem:
    The thread needs a pointer to the control. "A CWnd*". It works fine without windowlessActiv ate flag but with the flag I have no CWnd pointer to the control.

    Is there a way to get a pointer to the control even though it is windowless?
    The control is meant to bee used with an VB application. The app acts as a container to the control. Is it possible to attach the thread to the container instead of the control? Is there a way to get a pointer to the app?

    I am using Visual c++ 2005

    I hop somone has a answer.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    If you are creating a thread, then you have to use a ThreadProc. That sort of function has an LPVOID argument. You can devise a struct with the actual parameters, create a variable of that struct and load it with the real arguimants and then call CreateThread() using the argument of that variable.

    Your thread function will know the arguments points to a knowen type so you can cast back to the original struct and go from there.

    The fact a window is windowless does not mean it doesn't exist. It just means you can't see it. You should be able to use all of your normal Windows functions as long as there is no display.

    Comment

    Working...