This is a migrated thread and some comments may be shown as answers.

Host WPF window in Win32 window and SetPosition?

1 Answer 216 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
hallatie
Top achievements
Rank 1
hallatie asked on 02 Mar 2011, 04:44 AM

Hi,All:

My application use Win32 window to host my WPF window. I am using WindowInteropHelper to set my WPF window owner to the Win32 window handler. It works fine. But If I move the Win32 window (like to 2nd screen), the WPF window does not move with it.  I have to manually set the WPF window Left, top, Width and Height. Is this by design or did I miss something here?  What is the difference between the Owner and Parent (window)? Should I set the WPF parent window to the win32 handler to let the WPF window move with the win32 window?

Code snippet:

IntPtr win32WndHandler;

WindowInteropHelper helper = new WindowInteropHelper(myWPFWindow);
helper.Owner = win32WndHandler;

 

Thanks a lot

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 03 Mar 2011, 03:46 PM
Hello hallatie,

I am sure that you will get a lot of answers on Microsoft's WPF forums, since your question is more of a general WPF one than related in any way to Telerik controls.

Also, I believe that this MSDN article can help you:

WPF and Win32 Interoperation


I hope this helps.

All the best,
Ross
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
General Discussions
Asked by
hallatie
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or