Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1007
  • Last Modified:

Problem returning HTSYSMENU from WM_NCHITTEST message

I have a 32-bit windows SDK application (non-MFC) in
which the everything including the titlebar is drawn
with bitmaps.  I am implementing the System Menu by
responding to the WM_NCHITTEST message and returning
HTSYSMENU when the mouse is over the area I am considering
as the System Menu hotspot.  This works fine as long as
I define the hotspot as the upper left corner.  The
problem is that if I move the hotspot to another section
of my window, the System Menu never appears.  Is there
some kind of restriction that the System Menu must always
be placed in the upper left corner?
1 Solution
Custom painting an applications non client area is a real pain because yes windows seems to hardwire certain aspects of it. In particular their is indeed some special code with regard to the system menu. Also theres some wierdness with regard to painting of the caption buttons under Win98/2000.

One trick that may work for you is to send yourself the following undocumented message...
using this you could force the system menu to pop up at the desired x/y position.

WARNING : use the above at your own risk :-)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now