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:
Dim sysmnu As IntPtr = GetSystemMenu(Me.Handle, False) Dim mnuloc As Rectangle = _systemMenuButtonParams.ToRectangle(Me.Size) mnuloc.Offset(Me.Location.X, Me.Location.Y) TrackPopupMenu(sysmnu, TPM_LEFTALIGN Or TPM_NOANIMATION, mnuloc.Left, mnuloc.Bottom, 0, Me.Handle, Nothing)


Reply With Quote
