[Mono-winforms-list] Howto mix WinForms and Cairo?

Jonathan S. Chambers Jonathan.Chambers at ansys.com
Tue Sep 6 10:59:32 EDT 2005


I may be reading the code wrong. But doesn't Control::Handle return the
client handle? 

At least it looks like it is initialized with the client handle. Control
returns NativeWindow::Handle. The native window's handle is set by a
call to CreateHandle. This sets the handle value equal to the value
returned by XplatUI.CreateWindow. CreateWindow returns Hwnd::Handle,
which is initialized with the client window. 

Look at the setter of Hwnd::ClientWindow.

(Hope you can understand the mess above)
- Jonathan



-----Original Message-----
From: mono-winforms-list-bounces at lists.ximian.com
[mailto:mono-winforms-list-bounces at lists.ximian.com] On Behalf Of Peter
Dennis Bartok
Sent: Monday, September 05, 2005 9:46 PM
To: jackson at ximian.com; Miguel de Icaza
Cc: mono-winforms-list at lists.ximian.com
Subject: Re: [Mono-winforms-list] Howto mix WinForms and Cairo?

Yes, the handle that is returned by Control::Handle is of no use for
using 
with cairo. There's usually a window right on top of the one this handle

describes.

As I already answered before, to draw on our MWF windows, for best 
resultsSystem.Drawing should be used. We have no 'safety' locks and such
to 
deal with someone outside of MWF drawing on our windows alongside us. If
you 
try to own the whole window and do not expect MWF to draw, you'd need to
set 
the appropriate styles on Control (AllPaintingInWmPaint and UserPaint),
and 
get the Hwnd.Client handle via reflection to have the proper window do
muck 
with.

Cheers,
  Peter


-----Original Message-----
From: "Jackson Harper" <jackson at ximian.com>
To: "Miguel de Icaza" <miguel at ximian.com>
Cc: <mono-winforms-list at lists.ximian.com>; "Peter Dennis Bartok" 
<peter at novonyx.com>
Date: 05 September, 2005 13:25
Subject: Re: [Mono-winforms-list] Howto mix WinForms and Cairo?


>On Sat, 2005-09-03 at 17:37 -0400, Miguel de Icaza wrote:
>
>> I wonder if the Winforms handles are X handles, and if so, they could
be
>> used with Cairo.
>
>The X handle you would get back from Control::Handle is the entire
>window including the non client area (ie borders). (I think, Peter
could
>verify correctness here).
>
>I have a feeling mixing winforms and Mono.Cairo could lead to some
>unstable states though. Perhaps we should add some test cases for this.
>
>Jackson
>
>
>
>_______________________________________________
>Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>
> 

_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list




More information about the Mono-winforms-list mailing list