I am using this code from PSC to add an item to the systemmenu on my app, but when I click it, nothing happens. How can I make it do my code. And while I'm posting, how can I add a seperator bar to the menu? I tried just using this code and putting a "-" but that didn't work.
The code I am using:
VB Code:
Option Explicit Private Declare Function DrawMenuBar Lib "user32" _ (ByVal hWnd As Long) As Long Private Declare Function GetSystemMenu Lib "user32" _ (ByVal hWnd As Long, ByVal bRevert 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_STRING = &H0& Private Sub Form_Load() Dim SysMenu As Long SysMenu = GetSystemMenu(Me.hWnd, False) If SysMenu Then AppendMenu SysMenu, MF_STRING, 0, "YourItem" DrawMenuBar Me.hWnd End If End Sub
Thanks
-Joey




Reply With Quote