On Fri, Jan 9, 2009 at 10:51 AM, Thomas Hansen <[email protected]> wrote:
>
> this is a long shot...sorry i am not very experienced with win32 and
> this might be more of a win32 question than a pyglet question
>
> i have this pyglet app which runs in a nice window and implements a
> COM server so that it can be start and control it from Visual Basic
> etc.  What I would like to do is make it the window a child window of
> the actual application that launches it.
>
> I have tried calling:
> win32gui.SetParent(self._hwnd, parent_hwnd)
> within my window class (inherist from pyglet.window.Window) with
> little success..the window just disappears.
>
> other calls like win32gui.SetWindowPos(self._hwnd, ...) seem to work
> fine and have the expected effect
>
> Any ideas on how to accomplish this?  or is it simply not
> possible...I'm worried calling setParent destroys the OpenGl context
> or something like that..although there doesnt seeem to be any errors
> thrown by calling setParent.  I have looked at the pyglet window code
> for win32 and how it creates the window.  it calls CreateWindowExW;
> maybe I can hack pyglet here to achieve the desired effect?
>
> I'm really trying to avoid having to implement this app in C/C++ just
> so the window can be hooked to another appliaction window as a
> controll.  Any dieas?

I don't think reparenting the window is going to work.  However,
setting the window's parent in CreateWindowExW should work fine.
(Change the 0 under the 'height' argument to your parent window's
hwnd).

Alex.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to