WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 06-28-2012, 09:07 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I'm not sure this will work, but another method is to reparent the Vizard graphics window to the WPF window, instead of reusing the WPF window handle. This is what the Vizard Script -> Run Docked command does, and input messages still work properly.

Let the Vizard script create its own window as usual, but parent it to the handle passed to the command line:
Code:
viz.go()

import win32gui
import win32con

if(len(sys.argv) > 1):

    viz.window.setBorder(viz.BORDER_NONE)
    viz.window.setPosition([0,0])

    hwndChild = viz.window.getHandle()
    hwndParent = int(sys.argv[1])

    style = win32gui.GetWindowLong(hwndChild,win32con.GWL_STYLE)
    style = style | win32con.WS_CHILD
    style = style & ~(win32con.WS_OVERLAPPEDWINDOW | win32con.WS_POPUP)
    win32gui.SetWindowLong(hwndChild,win32con.GWL_STYLE,style)

    win32gui.SetParent(hwndChild ,hwndParent)
One important step with this method is that you will need to manually resize the Vizard graphics window when the parent window is resized. If you know the WPF control will always remain the same size, then you can hard code the size of the window in the Vizard script, or pass it as an argument.
Reply With Quote
 

Tags
<viz>.go, csharp, embed, win32, wpf


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
recording screen in vizard when embedded in wxpython Renato Lima Vizard 0 11-21-2011 01:10 PM
Vizard 4 Beta Testing farshizzo Announcements 0 02-01-2011 10:46 AM
Vizard 4 Beta Testing farshizzo Vizard 0 02-01-2011 10:46 AM
Vizard tech tip: Using the Python Imaging Library (PIL) Jeff Vizard 0 03-23-2009 11:13 AM
embedded Vizard tavaksai Vizard 5 12-21-2004 07:49 AM


All times are GMT -7. The time now is 05:27 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC