Exemplo n.º 1
0
 static public void SetWindowBounds(IntPtr handle, WindowRect rect)
 {
     if (!MoveWindow(handle, rect.X1, rect.Y1, rect.X2 - rect.X1, rect.Y2 - rect.Y1, true))
     {
         throw new InvalidOperationException();
     }
 }
Exemplo n.º 2
0
        void ClingToMaster(uint msg)
        {
            if (Interop.IsWindow(masterHandle))
            {
                try
                {
                    switch (msg)
                    {
                    case 0x07:
                        this.Topmost = true;
                        this.Topmost = false;
                        Interop.SetForegroundWindow(masterHandle);
                        break;

                    case 0x08:
                        break;

                    default:
                        if (Interop.IsIconic(masterHandle))
                        {
                            this.WindowState = WindowState.Minimized;
                        }
                        else
                        {
                            this.WindowState = WindowState.Normal;
                            WindowRect r = Interop.GetWindowBounds(masterHandle);
                            Interop.SetWindowBounds(thisHandle, new WindowRect(r.X2, r.Y1, r.X2 + (int)this.Width, r.Y2));
                            this.Opacity = 1.0f;
                        }
                        break;
                    }
                }
                catch
                {
                    Dispatcher.InvokeShutdown();
                }
            }
        }
Exemplo n.º 3
0
 public static void SetWindowBounds(IntPtr handle, WindowRect rect)
 {
     if (!MoveWindow(handle, rect.X1, rect.Y1, rect.X2 - rect.X1, rect.Y2 - rect.Y1, true))
         throw new InvalidOperationException();
 }
Exemplo n.º 4
0
 static extern bool GetWindowRect(IntPtr hWnd, out WindowRect lpRect);
Exemplo n.º 5
0
 static extern bool GetWindowRect(IntPtr hWnd, out WindowRect lpRect);