When I discussed some time ago why minimized windows have an apparent size of 160×31, I explained that the minimized icon is a miniature title bar, but I managed not to explain why the values are exactly 160 and 31.
The width of the miniature title bar is determined by the iWidth
member of MINIMIZEDMETRICS
structure. You can retrieve and change this structure with the help of the SystemParametersInfo
function. (Use the SPI_GETMINIMIZEDMETRICS
and SPI_SETMINIMIZEDMETRICS
flags, respectively.) Some people will mention the MinWidth
registry value, but those people are wrong. Notice, for example, that messing with MinWidth
requires a logoff cycle, whereas using SPI_SETMINIMIZEDMETRICS
takes effect immediately. That’s because SPI_SETMINIMIZEDMETRICS
updates the internal state variables, whereas whacking the registry just change a value in a database that nobody pays attention to once you’ve logged on.
What about the height? That’s just the height of a caption bar, which you can adjust from the Appearance tab of the Display control panel. (Programmatically, you can use that helpful SystemParametersInfo
function, this time using the iCaptionHeight
member of the NONCLIENTMETRICS
structure.)
0 comments