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

Jae Stutzman jaebird at gmail.com
Thu Sep 17 08:15:16 EDT 2009


2009/9/9 Stefanos A. <stapostol at gmail.com>:
> Την Wed, 09 Sep 2009 23:14:07 +0300,ο(η) Christian Hoff
> <christian_hoff at gmx.net> έγραψε:
>
>> Bingo! It's the foster window that enables theming. At least it worked
>> on a XP machine at school which I contaminated with Gtk# :-) . I
>> attached the new test application which should now work at least on XP
>> (the visual styles hack never worked on my Windows 7 machine). Again, it
>> would be great if you could give it a try on your machine to ensure it
>> works properly before we commit this.
>>
>
> Confirming success on Vista x86!
>
> Additionally, there is no need to keep the window lying around. Calling
> DestroyWindow immediately doesn't seem to be causing any problems.
>
> [DllImport ("user32.dll", EntryPoint="DestroyWindow",
> CharSet=CharSet.Unicode, CallingConvention=CallingConvention.StdCall)]
> internal extern static bool Win32DestroyWindow(IntPtr window);
>
> [...]
>
> // No idea why we need to create that window, but it enables visual styles
> on the Windows platform
> IntPtr window = Win32CreateWindow (WS_EX_TOOLWINDOW, "static", "Foster
> Parent Window", WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, IntPtr.Zero, IntPtr.Zero,
> IntPtr.Zero, IntPtr.Zero);
> Win32DestroyWindow(window);
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>

Bravo Folks!! This is a much better "hack" than the Windows.Forms call.

Jae


More information about the Gtk-sharp-list mailing list