PDA

View Full Version : vb6 maximize


xegallo
02-02-2002, 15:03
allora come posso fare a far si che quando chiudo un form me ne riappaia un altro (che era ridotto a icona)in dimensioni reali ?

xegallo
02-02-2002, 15:06
per ridurlo a icona ho fatto cosė:

sez dichiarazioni modulo

Public Const SW_MINIMIZE = 6
Public Rectan As RECT
Type POINTAPI
x As Long
y As Long
End Type
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Type WINDOWPLACEMENT
Length As Long
flags As Long
showCmd As Long
ptMinPosition As POINTAPI
ptMaxPosition As POINTAPI
rcNormalPosition As RECT
End Type
Declare Function ClientToScreen Lib "user32" _
(ByVal hwnd As Long, lpPoint As POINTAPI) As Long
Declare Function GetWindowPlacement Lib "user32" _
(ByVal hwnd As Long, lpwndpl As WINDOWPLACEMENT) As Long
Declare Function SetWindowPlacement Lib "user32" _
(ByVal hwnd As Long, lpwndpl As WINDOWPLACEMENT) As Long

nel form_load

Dim WinEst As WINDOWPLACEMENT
Dim rtn As Long
WinEst.Length = Len(WinEst)
'get the current window placement
rtn = GetWindowPlacement(Me.hwnd, WinEst)
Rectan = WinEst.rcNormalPosition

nella routine per ridurlo
'set the new min/max positions
punto.x = 100
punto.y = 100
'initialize the structure
WinEst.Length = Len(WinEst)
WinEst.showCmd = SW_MINIMIZE
WinEst.ptMinPosition = punto
WinEst.ptMaxPosition = punto
WinEst.rcNormalPosition = Rectan
'set the new window placement (minimized)
rtn = SetWindowPlacement(Me.hwnd, WinEst)


grazie a chiunque mi aiuta