Solved

Problem returning HTSYSMENU from WM_NCHITTEST message

Posted on 2001-07-02
1
947 Views
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?
0
Comment
Question by:kaplan1
1 Comment
 
LVL 5

Accepted Solution

by:
robpitt earned 100 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...
  SendMessage(hWnd,0x313,0,MAKELONG(xPos,yPos))
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 :-)

Rob
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now