Add minimize and maximize button to fixed dialog
Posted on 2006-11-09
I want to have a form that has typical set of title buttons. Min/Max/Close. I want to block Max. What I have right now is a sizeable form with Max button blocked and also I use this code to prevent user from resizing manually:
Public Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Public Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public Const SC_SIZE = &HF000&
Public Const MF_BYCOMMAND = &H0&
Private Sub Form_Load()
Dim hMenu As Long
Dim fSuccess As Long
hMenu = GetSystemMenu(Me.hwnd, 0)
fSuccess = DeleteMenu(hMenu, SC_SIZE, MF_BYCOMMAND)
It won't let resize but whenever I put mouse over the border it shows that resize arrow cursor. I want a regular cursor.
Is there a way to show default cursor in this case? If no, how can I add min and max buttons (with max being blocked) on form set to fixed dialog?