Hi.
I'm writing a panel that is located on the top of the screen. The panel should be always visible and should not cover title bars of maximized windows - just like taskbar with start menu when it's located on the top. Any panel in Windows limits desktop client area (just try to minimize all the windows and drag a folder to a free edge of your desktop, then right-click it -> top-most and maximize some window). It's (client area's) dimensions are returned by SM_CXFULLSCREEN and SM_CYFULLSCREEN system metrics. How can I make my window change those values so it does not block the title bars, and then restore them when the program is closed?
Thank you.
I'm not sure if this is the most correct way of doing it or if Microsoft provides a way to do this for you, but I can easily think of checking the dimensions each time changed to make sure they go by your standards and if not, change it back to the way it was. Simple, effective, and I don't see why not.
Thank you for your reply.
That's exactly what I'm trying to do - to change the values returned by SM_CYFULLSCREEN to tell the maximized windows their new height and somehow (how?) tell them their new y-coordinate, so my program does not overlap them. I do not know how to do those things, that's what I'm asking.
Client applications should be calling SystemParametersInfo( SPI_GETWORKAREA, ... ); if they need to know that information. Most don't, and can just use ShowWindow() to modify their window's status.
You can adjust the "work area" yourself:
1 2 3 4 5 6 7 8 9 10 11
RECT workarea;
// Get the current work area
SystemParametersInfo( SPI_GETWORKAREA, 0, &workarea, 0 );
// modify 'workarea' here: either subtract your application's
// space (after starting up) or add it back in (before terminating)
...
// Set the new work area and broadcast the change to all running applications
SystemParametersInfo( SPI_SETWORKAREA, 0, &workarea, SPIF_SENDCHANGE );