Есть форма с BorderStyle=0. Если вдруг WindowState становится равно vbMaximized, форма накрывает собой таскбар.
Вопрос: почему так, и как бороться?
Ответа на этот простой вроде бы вопрос я на форуме не нашёл.
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Private Declare Sub 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)
SetWindowPos Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
Option Explicit
Const SM_CYCAPTION = 4
Const SM_CXSCREEN = 0
Const SM_CYSCREEN = 1
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Const SWP_SHOWWINDOW = &H40
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 Form_DblClick()
Dim lngCY As Long
Dim lngCX As Long
Dim lngCaption As Long
lngCY = GetSystemMetrics(SM_CYSCREEN)
lngCX = GetSystemMetrics(SM_CXSCREEN)
lngCaption = GetSystemMetrics(SM_CYCAPTION)
Call SetWindowPos(Me.hwnd, 0, 0, 0, lngCX, lngCY - lngCaption, SWP_SHOWWINDOW)
End Sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 60