Archive
Posts Tagged ‘SystemParametersInfo’
SystemParametersInfo
May 24, 2008
Leave a comment
SystemParametersInfo is a powerful function which does and retrieves whole lot of things related to windows general behavior for eg: turning on and off certain features like mouse trails which we normally do via control panel->main.cpl
Look up MSDN for more information on SystemParametersInfo. I’ll just show a demo on how to turn on and off mouse trails…
// Turn on mouse trails, showing 10 cursors drawn in the trail SystemParametersInfo( SPI_SETMOUSETRAILS, 10, 0, 0 ); // Turn off mouse trails, set trail count to 1 or zero to disable trails SystemParametersInfo( SPI_SETMOUSETRAILS, 1, 0, 0 );
Categories: Windows API
SPI_SETMOUSETRAILS, SystemParametersInfo
Retrieve work area rectangle using SystemParametersInfo!
March 24, 2008
Leave a comment
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.