[Mono-dev] [Gtk-sharp-list] Gtk depends on Winforms ¿?

Christian Hoff christian_hoff at gmx.net
Wed Sep 9 12:20:25 EDT 2009


Stefanos A. wrote:
> Την Wed, 09 Sep 2009 18:05:42 +0300,ο(η) Christian Hoff 
> <christian_hoff at gmx.net> έγραψε:
>
>> I would really appreciate some feedback from the community as to whether
>> the new approach works (that is, if the attached application appears
>> with visual styles enabled). Just reply with a screenshot of the running
>> app on XP if you're not sure what I mean :-) .
>
> Didn't render with visual styles here (Vista x86 Business w/ SP2).
>
> What magic sauce is Application.DoEvents using? I wonder if it is 
> performing any static initialization (static constructors and/or fields).
>
By now I tried:

MSG msg = new MSG ();
while (Win32PeekMessage (ref msg, IntPtr.Zero, 0, 0, PM_REMOVE)) {
         Console.WriteLine ("Got a message");
          Win32TranslateMessage (ref msg);
          Win32DispatchMessage (ref msg);
}

On my Windows 7 machine, PeekMessage returns false.

Now that emulating DoEvents does not seem to fix it, I'm looking at the 
static constructor of XplatUIWin32, the class that also contains the 
"real" code for DoEvents. Besides initialization stuff, it creates a 
"foster window":

wnd_proc = new WndProc(InternalWndProc);
FosterParent=Win32CreateWindow(WindowExStyles.WS_EX_TOOLWINDOW, 
"static", "Foster Parent Window", WindowStyles.WS_OVERLAPPEDWINDOW, 0, 
0, 0, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);

Prepending that code to the workaround should make it work. I will 
create a test app ASAP.

Thanks,


Christian


More information about the Mono-devel-list mailing list