Go Premium for a chance to win a PS4. Enter to Win


Problem returning HTSYSMENU from WM_NCHITTEST message

Posted on 2001-07-02
Medium Priority
Last Modified: 2013-12-03
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?
Question by:kaplan1
1 Comment

Accepted Solution

robpitt earned 400 total points
ID: 6247818
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 :-)


Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question