When you use SetWindowPos in this respect, you don't need to declare all the constants, because you only need to '3' as the flag. This can shorten your by a lot.
Code:Private Declare Function SetWindowPos Lib "user32" (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 Sub Command1_Click() SetWindowPos hWnd, -1, 0, 0, 0, 0, 3 End Sub




Reply With Quote