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:
  1. Option Explicit
  2.  
  3.  
  4. Private Declare Function DrawMenuBar Lib "user32" _
  5. (ByVal hWnd As Long) As Long
  6.  
  7.  
  8. Private Declare Function GetSystemMenu Lib "user32" _
  9. (ByVal hWnd As Long, ByVal bRevert As Long) As Long
  10.  
  11.  
  12. Private Declare Function AppendMenu Lib "user32" Alias _
  13. "AppendMenuA" (ByVal hMenu As Long, ByVal wFlags _
  14. As Long, ByVal wIDNewItem As Long, ByVal lpNewItem _As Any) As Long
  15. Const MF_STRING = &H0&
  16.  
  17.  
  18. Private Sub Form_Load()
  19. Dim SysMenu As Long
  20. SysMenu = GetSystemMenu(Me.hWnd, False)
  21.  
  22.  
  23. If SysMenu Then
  24. AppendMenu SysMenu, MF_STRING, 0, "YourItem"
  25. DrawMenuBar Me.hWnd
  26. End If
  27. End Sub

Thanks
-Joey