mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-05-03 02:06:26 +00:00
2009-09-11 Christian Hoff <christian_hoff@gmx.net>
* gtk/Application.cs: Port the theming-relevant part of the SWF.Application.DoEvents code to avoid loading the assembly at runtime on the Windows platform. svn path=/trunk/gtk-sharp/; revision=141783
This commit is contained in:
parent
7b752d233c
commit
5f51d09626
|
@ -1,3 +1,9 @@
|
||||||
|
2009-09-11 Christian Hoff <christian_hoff@gmx.net>
|
||||||
|
|
||||||
|
* gtk/Application.cs: Port the theming-relevant part of the
|
||||||
|
SWF.Application.DoEvents code to avoid loading the assembly
|
||||||
|
at runtime on the Windows platform.
|
||||||
|
|
||||||
2009-09-03 Christian Hoff <christian_hoff@gmx.net>
|
2009-09-03 Christian Hoff <christian_hoff@gmx.net>
|
||||||
|
|
||||||
* glib/Global.cs: Kill the calling convention field again.
|
* glib/Global.cs: Kill the calling convention field again.
|
||||||
|
|
|
@ -34,6 +34,15 @@ namespace Gtk {
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const int WS_EX_TOOLWINDOW = 0x00000080;
|
||||||
|
const int WS_OVERLAPPEDWINDOW = 0x00CF0000;
|
||||||
|
|
||||||
|
[DllImport ("user32.dll", EntryPoint="CreateWindowExW", CharSet=CharSet.Unicode, CallingConvention=CallingConvention.StdCall)]
|
||||||
|
static extern IntPtr Win32CreateWindow (int dwExStyle, string lpClassName, string lpWindowName,int dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hWndParent, IntPtr hMenu, IntPtr hInstance, IntPtr lParam);
|
||||||
|
|
||||||
|
[DllImport ("user32.dll", EntryPoint="DestroyWindow", CharSet=CharSet.Unicode, CallingConvention=CallingConvention.StdCall)]
|
||||||
|
static extern bool Win32DestroyWindow (IntPtr window);
|
||||||
|
|
||||||
static Application ()
|
static Application ()
|
||||||
{
|
{
|
||||||
if (!GLib.Thread.Supported)
|
if (!GLib.Thread.Supported)
|
||||||
|
@ -44,10 +53,9 @@ namespace Gtk {
|
||||||
case PlatformID.Win32S:
|
case PlatformID.Win32S:
|
||||||
case PlatformID.Win32Windows:
|
case PlatformID.Win32Windows:
|
||||||
case PlatformID.WinCE:
|
case PlatformID.WinCE:
|
||||||
Assembly assm = Assembly.Load ("System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
|
// No idea why we need to create that window, but it enables visual styles on the Windows platform
|
||||||
Type swfapp = assm.GetType ("System.Windows.Forms.Application");
|
IntPtr window = Win32CreateWindow (WS_EX_TOOLWINDOW, "static", "gtk-sharp visual styles window", WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
|
||||||
MethodInfo method = swfapp.GetMethod ("DoEvents", BindingFlags.Public | BindingFlags.Static);
|
Win32DestroyWindow (window);
|
||||||
method.Invoke (null, null);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue