Home > Windows API > Retrieve work area rectangle using SystemParametersInfo!

Retrieve work area rectangle using SystemParametersInfo!

Work area is that area of the screen excluding windows task bars and other custom application bars.

Simplest way to retrieve this area is to call SystemParametersInfo. Here is an e.g.

RECT rcWorkArea = { 0 };
SystemParametersInfo( SPI_GETWORKAREA, 0, &rcWorkArea, 0 );
AfxTrace( _T( "Work area: %d, %d, %d, %d" ), rcWorkArea.left, rcWorkArea.top, rcWorkArea.right, rcWorkArea.bottom );

Limitation of this method is that this returns only the primary monitor work area information, to retrieve information pertaining to multiple monitors call GetMonitorInfo.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: