Solved

Problem returning HTSYSMENU from WM_NCHITTEST message

Posted on 2001-07-02
1
954 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

728 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