Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - HwndSource not rendering when come into view

 
 
Old 03-29-2006   #1 (permalink)
MueMeister


 
 

HwndSource not rendering when come into view

Hi there,

I got a short question on interop with MFC. In an complex MFC-app I
have a CStatic-object as the placeholder for the WPF-Contol. I use a
HwndSource-object to wrap the WPF-stuff inside it. The size of the
CStatic should also be the size of the HwndSource's HWND which I
retrieve through:
myHwnd = (HWND)hwndSource->Handle.ToPointer();

Now, I start the appication but the control doesn't show up. It only
appears if I resize the app cause the CStatic reacts to WM_SIZE message.
In the message handler OnSize(..) I do SetWindowPos(...) on the
myHwnd-object and voila, the WPF-Control is visible.

I checked that the HwndSourceParameters-object is initialized correctly.
I also checked that the dimensions of the hwnd is valid ats startup and
during runtime. I also tried to force redraw on the myHwnd-object but
without success.

Any ideas why the window is not painting itsself at startup and only
appears after resize (SetWindowPos(..))?

Thanks
Chris :-)

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
games Rendering everywhere! Vista Games
Page Rendering Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46