// Peter Bartok pbartok@novell.com
//
//
-// $Revision: 1.7 $
+// $Revision: 1.8 $
// $Modtime: $
// $Log: XplatUI.cs,v $
+// Revision 1.8 2004/08/11 18:55:46 pbartok
+// - Added method to calculate difference between decorated window and raw
+// client area
+//
// Revision 1.7 2004/08/10 17:39:22 pbartok
// - Added GetWindowPos method
//
internal static void GrabWindow(IntPtr hWnd) {
driver.GrabWindow(hWnd);
}
+
internal static void ReleaseWindow(IntPtr hWnd) {
driver.ReleaseWindow(hWnd);
}
+ internal static bool CalculateWindowRect(IntPtr hWnd, ref Rectangle ClientRect, int Style, bool HasMenu, out Rectangle WindowRect) {
+ return driver.CalculateWindowRect(hWnd, ref ClientRect, Style, HasMenu, out WindowRect);
+ }
+
// Santa's little helper
internal static void Where() {
Console.WriteLine("Here: {0}", new StackTrace().ToString());
// Peter Bartok pbartok@novell.com
//
//
-// $Revision: 1.7 $
+// $Revision: 1.8 $
// $Modtime: $
// $Log: XplatUIDriver.cs,v $
+// Revision 1.8 2004/08/11 18:55:46 pbartok
+// - Added method to calculate difference between decorated window and raw
+// client area
+//
// Revision 1.7 2004/08/10 17:39:22 pbartok
// - Added GetWindowPos method
//
internal abstract bool MoveWindow(IntPtr hWnd, int x, int y, int width, int height);
internal abstract bool DispatchMessage(ref MSG msg);
+ internal abstract bool CalculateWindowRect(IntPtr hWnd, ref Rectangle ClientRect, int Style, bool HasMenu, out Rectangle WindowRect);
+
internal abstract void GrabWindow(IntPtr hWnd);
internal abstract void ReleaseWindow(IntPtr hWnd);
#endregion // XplatUI Driver Methods
// Peter Bartok pbartok@novell.com
//
//
-// $Revision: 1.9 $
+// $Revision: 1.10 $
// $Modtime: $
// $Log: XplatUIWin32.cs,v $
+// Revision 1.10 2004/08/11 18:55:46 pbartok
+// - Added method to calculate difference between decorated window and raw
+// client area
+//
// Revision 1.9 2004/08/10 18:47:16 jordi
// Calls InvalidateRect before UpdateWindow
//
Win32ReleaseCapture();
}
+ internal override bool CalculateWindowRect(IntPtr hWnd, ref Rectangle ClientRect, int Style, bool HasMenu, out Rectangle WindowRect) {
+ RECT rect;
+
+ rect.left=ClientRect.Left;
+ rect.top=ClientRect.Top;
+ rect.right=ClientRect.Right;
+ rect.bottom=ClientRect.Bottom;
+
+ if (!Win32AdjustWindowRectEx(ref rect, Style, HasMenu, 0)) {
+ WindowRect = new Rectangle(ClientRect.Left, ClientRect.Top, ClientRect.Width, ClientRect.Height);
+ return false;
+ }
+
+ WindowRect = new Rectangle(rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top);
+ return true;
+ }
+
// Santa's little helper
static void Where() {
Console.WriteLine("Here: {0}", new StackTrace().ToString());
[DllImport ("user32.dll", EntryPoint="SetActiveWindow", CharSet=CharSet.Ansi, CallingConvention=CallingConvention.StdCall)]
private extern static IntPtr Win32SetActiveWindow(IntPtr hWnd);
+
+ [DllImport ("user32.dll", EntryPoint="PostQuitMessage", CharSet=CharSet.Ansi, CallingConvention=CallingConvention.StdCall)]
+ private extern static IntPtr Win32PostQuitMessage(IntPtr hWnd);
+
+ [DllImport ("user32.dll", EntryPoint="AdjustWindowRectEx", CharSet=CharSet.Ansi, CallingConvention=CallingConvention.StdCall)]
+ private extern static bool Win32AdjustWindowRectEx(ref RECT lpRect, int dwStyle, bool bMenu, int dwExStyle);
#endregion
}
// Peter Bartok pbartok@novell.com
//
//
-// $Revision: 1.16 $
+// $Revision: 1.17 $
// $Modtime: $
// $Log: XplatUIX11.cs,v $
+// Revision 1.17 2004/08/11 18:55:46 pbartok
+// - Added method to calculate difference between decorated window and raw
+// client area
+//
// Revision 1.16 2004/08/10 17:39:22 pbartok
// - Added GetWindowPos method
//
XUngrabPointer(DisplayHandle, 0);
}
+ internal override bool CalculateWindowRect(IntPtr hWnd, ref Rectangle ClientRect, int Style, bool HasMenu, out Rectangle WindowRect) {
+ WindowRect = new Rectangle(ClientRect.Left, ClientRect.Top, ClientRect.Width, ClientRect.Height);
+ return true;
+ }
+
// Santa's little helper
static void Where() {
Console.WriteLine("Here: {0}", new StackTrace().ToString());