Results 1 to 3 of 3

Thread: Mounting main menu to the icon on headerbar

  1. #1

    Thread Starter
    Hyperactive Member Jareware's Avatar
    Join Date
    Nov 2000
    Location
    Silicon Valley, CA
    Posts
    275

    Lightbulb

    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-

  2. #2
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    this will add new menu choice to the system menu:
    Code:
    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
    Don't know if it's what you want
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  3. #3

    Thread Starter
    Hyperactive Member Jareware's Avatar
    Join Date
    Nov 2000
    Location
    Silicon Valley, CA
    Posts
    275

    Talking

    Seems to be, thanks,


    -JR-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width