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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Peter
Dennis Bartok
Sent: Monday, September 05, 2005 9:46 PM
To: [EMAIL PROTECTED]; Miguel de Icaza
Cc: [email protected]
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" <[EMAIL PROTECTED]>
To: "Miguel de Icaza" <[EMAIL PROTECTED]>
Cc: <[email protected]>; "Peter Dennis Bartok" 
<[EMAIL PROTECTED]>
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  -  [email protected]
>http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>
> 

_______________________________________________
Mono-winforms-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list


_______________________________________________
Mono-winforms-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Reply via email to