- Код: Выделить всё
lRet = GetWindowLong(hwnd, GWL_STYLE)
SetWindowLong hwnd, GWL_STYLE, lRet Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
Несмотря на то, что пример взят с сайта MS.
lRet = GetWindowLong(hwnd, GWL_STYLE)
SetWindowLong hwnd, GWL_STYLE, lRet Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
Select Case Sizable
Case "sizable" ': Set frm = New frmSizable
Set frm = New frmFixed
frm.BorderStyle = 2
lRet = GetWindowLong(frm.hwnd, GWL_STYLE)
SetWindowLong frm.hwnd, GWL_STYLE, lRet Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
Case "fixed": Set frm = New frmFixed
Case "mdi": Set frm = New MDIForm1
Case "mdichild": Set frm = New frmMDIChild
End Select
MSDN писал(а):If you have changed certain window data using SetWindowLong, you must call SetWindowPos to have the changes take effect. Use the following combination for uFlags: SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED.
Select Case Sizable
Case "sizable" ': Set frm = New frmSizable
Set frm = New frmFixed
frm.BorderStyle = 2
lRet = GetWindowLong(frm.hwnd, GWL_STYLE)
SetWindowLong frm.hwnd, GWL_STYLE, lRet Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
SetWindowPos frm.hwnd, 0, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE Or SWP_NOZORDER Or SWP_FRAMECHANGED
Case "fixed": Set frm = New frmFixed
Case "mdi": Set frm = New MDIForm1
Case "mdichild": Set frm = New frmMDIChild
End Select
lRet = GetWindowLong(hwnd, GWL_STYLE)
SetWindowLong Me.hwnd, GWL_STYLE, lRet Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
ReleaseCapture
SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
lRet = GetWindowLong(hwnd, GWL_STYLE)
SetWindowLong Me.hwnd, GWL_STYLE, lRet Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
me.Caption = me.Caption
me.Hide
me.Show
Сейчас этот форум просматривают: AhrefsBot и гости: 77