Const WS_BORDER = &H800000 Const WS_DLGFRAME = &H400000 Const WS_THICKFRAME = &H40000 Const WS_CAPTION = &HC00000 ' WS_BORDER Or WS_DLGFRAME Const HWND_BOTTOM = 1 Const HWND_TOP = 0 Const HWND_TOPMOST = -1 Const HWND_NOTOPMOST = -2 Const SWP_SHOWWINDOW = &H40 Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Declare Function AdjustWindowRect Lib "user32" (lpRect As RECT, ByVal dwStyle As Long, ByVal bMenu As Long) As Long Private Declare Function BeginDeferWindowPos Lib "user32" (ByVal nNumWindows As Long) As Long Private Declare Function DeferWindowPos Lib "user32" (ByVal hWinPosInfo As Long, ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function EndDeferWindowPos Lib "user32" (ByVal hWinPosInfo As Long) As Long Private Sub Form_Load() 'KPD-Team 2000 'URL: http://www.allapi.net/ 'E-Mail: KPDTeam@Allapi.net Dim R As RECT, hDWP As Long R.Left = 30 R.Top = 30 R.Bottom = 200 R.Right = 120 AdjustWindowRect R, WS_THICKFRAME Or WS_CAPTION, False hDWP = BeginDeferWindowPos(1) DeferWindowPos hDWP, Me.hwnd, HWND_TOP, R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top, SWP_SHOWWINDOW EndDeferWindowPos hDWP End Sub |