Is it possible to make a certain menu appear when you click on the icon on a windows standard headerbar (like where those Move and Close commands are located)?
-JR-
Printable View
Is it possible to make a certain menu appear when you click on the icon on a windows standard headerbar (like where those Move and Close commands are located)?
-JR-
this will add new menu choice to the system menu:
Don't know if it's what you wantCode:Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As Any) As Long
Const MF_CHECKED = &H8&
Const MF_APPEND = &H100&
Const MF_DISABLED = &H2&
Const MF_GRAYED = &H1&
Const MF_SEPARATOR = &H800&
Const MF_STRING = &H0&
Private Sub Form_Load()
Dim hSysMenu As Long, nCnt As Long
' Get handle to our form's system menu
' (Restore, Maximize, Move, close etc.)
hSysMenu = GetSystemMenu(Me.hwnd, False)
If hSysMenu Then
AppendMenu hSysMenu, MF_SEPARATOR, ByVal 0&, "-"
AppendMenu hSysMenu, MF_STRING, ByVal 0&, "Hello !"
DrawMenuBar Me.hwnd
' Force caption bar's refresh. Disabling X button
End If
End Sub
Seems to be, thanks,
-JR-