"Piske, Harald" wrote:

> I'm impressed - here's somebody who knows how to translate general ideas
> into formal terminology.

Thanks for the attaboy.  It was just what I needed to inspire further
research...

> I don't have a solution at hand but with what you
> say, you should be able to figure it out. I'm not aware of any ready-made
> windoze function to give you the "effective desktop client area after
> accounting for taskbars", but that does not mean there is none. I'm not
> really at home in the win ref manuals.

I am.  Now.  Post research :)   Research is below for the interested.  Next
research project is to figure out how to use Win32::API well enough to benefit
from the research...

> Just one more note: my wife has a toolbar on her computer that is nothing
> but a small collection of buttons. Looks like it was invented before Win98
> came along with it's quick-launch thingy. That is only around 10% of the
> screen width and just one row of icons high.

I've seen some of those.  Not too concerned about them, either.

Here's the relevant pieces of the results of the research through MSDN:

BOOL SystemParametersInfo(
  UINT uiAction, // system parameter to query or set
  UINT uiParam,  // depends on action to be taken
  PVOID pvParam, // depends on action to be taken
  UINT fWinIni   // user profile update flag
);

when uiAction == SPI_GETWORKAREA

Retrieves the size of the work area on the primary display monitor. The work
area is the portion of the screen not obscured by the system taskbar or by
application desktop toolbars. The pvParam parameter must point to a RECT
structure that receives the coordinates of the work area, expressed in virtual
screen coordinates.

To get the work area of a monitor other than the primary display monitor, call
the GetMonitorInfo function.


RECT

The RECT structure defines the coordinates of the upper-left and lower-right
corners of a rectangle.

typedef struct _RECT {
    LONG left;
    LONG top;
    LONG right;
    LONG bottom;
} RECT;

Members
left   Specifies the x-coordinate of the upper-left corner of the rectangle.
top    Specifies the y-coordinate of the upper-left corner of the rectangle.
right  Specifies the x-coordinate of the lower-right corner of the rectangle.
bottom Specifies the y-coordinate of the lower-right corner of the rectangle.

Remarks

When RECT is passed to the FillRect function, the rectangle is filled up to, but
not including, the right column and bottom row of pixels. This structure is
identical to the RECTL structure.

So it looks like the C/C++ code for this would go approximately like:

RECT workarea;
BOOL ret;

ret = SystemParametersInfo ( SPI_GETWORKAREA, 0, & workarea, 0 );
if ( ! ret )
{ ... GetLastError ...
}
// workarea can be determined from workarea.left, workarea.top, etc.

--
Glenn
=====
Due to the current economic situation, the light at the
end of the tunnel will be turned off until further notice.



Reply via email to