Discussione: vb6 maximize
View Single Post
Old 02-02-2002, 15:06   #2
xegallo
Member
 
Iscritto dal: Jan 2001
Città: PATAVIUM
Messaggi: 280
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
__________________
Salva il Pianeta
xegallo è offline   Rispondi citando il messaggio o parte di esso