Win32: Menu position
Does anyone know how I can change the position of an HMENU that is attached to a window?
I would like to be able to move the menu from its default position (which is either (SM_CXFRAME, SM_CYFRAME + SM_CYCAPTION) or (SM_CXFIXEDFRAME, SM_CYFIXEDFRAME + SM_CYCAPTION) depending on whether the window is sizeable or not).
I know that I can move it around by changing the system metrics of the frame and caption, but I would like to be able to move it without doing that.
Also, the windows that I want to move the menu for do not belong to my application''s process, and therefore I can''t just create some customized menu class to take the place of the default menu.
I know that it is possible because WindowBlinds does this without having to change the system metrics.
Thanks,
Aeetes
Wow. Good question. Maybe you could try handling the WM_NCCALCSIZE and add more height for the non-client area? just guessing.
That doesn't work. Handling of the WM_NCCALCSIZE message allows for the positioning of the client rectangle within the window rectangle. Since the menu of a window is considered to be part of the non-client area, increasing the height of the non-client area above the window succeeds in creating more space, but the position of the menu is not affected as it is placed relative to the top-left corner of the window rectangle.
I will say a little about exactly what I am trying to do and what I have done towards that goal, so that maybe my problem can be better understood. I am creating a shell extension (can sortof call it that) that creates a vertical tray, placed along the left side of the active window, containing icons of running applications allowing for quick task switching (I plan on combining this with a new shell (or just using Litestep) to replace explorer.exe).
I have implemented the neccessary system hooks and window subclassing to be able to customize the drawing and control of the active window. Visually, in order to do this I need to make enough room in the non-client area to fit the tray. I have shifted the client area over to the right by intercepting WM_NCCALCSIZE. All I need to do besides my own task tray drawing is shift the menu to the right as well so that it lines up with the client area.
Anyone know how that can be done?
Aeetes
Edited by - Aeetes on May 2, 2001 12:41:45 AM
I will say a little about exactly what I am trying to do and what I have done towards that goal, so that maybe my problem can be better understood. I am creating a shell extension (can sortof call it that) that creates a vertical tray, placed along the left side of the active window, containing icons of running applications allowing for quick task switching (I plan on combining this with a new shell (or just using Litestep) to replace explorer.exe).
I have implemented the neccessary system hooks and window subclassing to be able to customize the drawing and control of the active window. Visually, in order to do this I need to make enough room in the non-client area to fit the tray. I have shifted the client area over to the right by intercepting WM_NCCALCSIZE. All I need to do besides my own task tray drawing is shift the menu to the right as well so that it lines up with the client area.
Anyone know how that can be done?
Aeetes
Edited by - Aeetes on May 2, 2001 12:41:45 AM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement