Results 1 to 4 of 4

Thread: Manually displaying a system menu

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 1999
    Location
    California, USA
    Posts
    662

    Manually displaying a system menu

    I'm making a form that has a completely owner-draw nonclient area and have to manually hittest to open the system menu.

    The code below opens the system menu, but the items don't do anything whn you click them.

    Any ideas?

    (you can specify an x,y coordinate in place of my code which places the menu neatly underneath the button.)

    GetSystemMenu and TrackPopupMenu are win32 api functions.

    vb.net Code:
    1. Dim sysmnu As IntPtr = GetSystemMenu(Me.Handle, False)
    2. Dim mnuloc As Rectangle = _systemMenuButtonParams.ToRectangle(Me.Size)
    3. mnuloc.Offset(Me.Location.X, Me.Location.Y)
    4. TrackPopupMenu(sysmnu, TPM_LEFTALIGN Or TPM_NOANIMATION, mnuloc.Left, mnuloc.Bottom, 0, Me.Handle, Nothing)

  2. #2

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 1999
    Location
    California, USA
    Posts
    662

    Re: Manually displaying a system menu

    I could have sworn that a system menu being popped up in this manner would still send the commands to the window as wm_syscommand, not wm_command. maybe i'm not understanding it quite right?

  4. #4

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