Option Explicit ' ShowWindow() CommandsPrivate Const SW_HIDE = 0Private Const SW_SHOWNORMAL = 1Private Const SW_NORMAL = 1Private Const SW_SHOWMINIMIZED = 2Private Const SW_SHOWMAXIMIZED = 3Private Const SW_MAXIMIZE = 3Private Const SW_SHOWNOACTIVATE = 4Private Const SW_SHOW = 5Private Const SW_MINIMIZE = 6Private Const SW_SHOWMINNOACTIVE = 7Private Const SW_SHOWNA = 8Private Const SW_RESTORE = 9Private Const SW_SHOWDEFAULT = 10Private Const SW_MAX = 10 Private Type POINTAPI x As Long y As LongEnd TypePrivate Type RECT Left As Long Top As Long Right As Long Bottom As LongEnd TypePrivate Type WindowPlacement Length As Long flags As Long showCmd As Long ptMinPosition As POINTAPI ptMaxPosition As POINTAPI rcNormalPosition As RECTEnd Type Private Declare Function GetWindowPlacement Lib "user32" (ByVal hWnd As Long, lpwndpl As WindowPlacement) As LongPrivate Declare Function SetWindowPlacement Lib "user32" (ByVal hWnd As Long, lpwndpl As WindowPlacement) As Long Private Sub Form_Click() Dim lResult As Long Dim WPL As WindowPlacement Dim hWnd As Long hWnd = Me.hWnd WPL.Length = Len(WPL) lResult = GetWindowPlacement(hWnd, WPL) If lResult = 0 Then MsgBox "Ist schiefgelaufen." Exit Sub End If WPL.showCmd = SW_RESTORE lResult = SetWindowPlacement(hWnd, WPL) If lResult = 0 Then MsgBox "Ist schiefgelaufen." Exit Sub End IfEnd Sub Private Sub Form_Load() Me.WindowState = vbMaximizedEnd SubViel Erfolg!Thomas Prötzschcu
Thomas Prötzsch
geschrieben von
Thomas Proetzsch
,
16.08.2000, 04:32 Uhr
, 50 mal gelesen