WinAPI:SetWindowPos-ウィンドウの位置と状態を変更する


WinAPI:SetWindowPos-ウィンドウの位置と状態を変更する
 
  
//  :
SetWindowPos(
  hWnd: HWND;            {    }
  hWndInsertAfter: HWND; {    Z   }
  X, Y: Integer;         {  }
  cx, cy: Integer;       {  }
  uFlags: UINT           {  }
): BOOL;

//hWndInsertAfter      :
HWND_TOP       = 0;        {   }
HWND_BOTTOM    = 1;        {   }
HWND_TOPMOST   = HWND(-1); {   ,            }
HWND_NOTOPMOST = HWND(-2); {   ,            }

//uFlags      :
SWP_NOSIZE         = 1;    {   cx、cy,     }
SWP_NOMOVE         = 2;    {   X、Y,      }
SWP_NOZORDER       = 4;    {   hWndInsertAfter,    Z   }
SWP_NOREDRAW       = 8;    {   }
SWP_NOACTIVATE     = $10;  {   }
SWP_FRAMECHANGED   = $20;  {     WM_NCCALCSIZE   ,                 }
SWP_SHOWWINDOW     = $40;  {    }
SWP_HIDEWINDOW     = $80;  {    }
SWP_NOCOPYBITS     = $100; {     }
SWP_NOOWNERZORDER  = $200; {   hWndInsertAfter,     Z       }
SWP_NOSENDCHANGING = $400; {    WM_WINDOWPOSCHANGING   }
SWP_DRAWFRAME      = SWP_FRAMECHANGED; {   }
SWP_NOREPOSITION   = SWP_NOOWNERZORDER;{}
SWP_DEFERERASE     = $2000;            {     WM_SYNCPAINT   }
SWP_ASYNCWINDOWPOS = $4000;            {          ,                }
//  :
procedure TForm1.Button1Click(Sender: TObject);
begin
  SetWindowPos(Handle, HWND_TOPMOST, 0,0, 100,200, SWP_SHOWWINDOW);