I have a toolbar developed under older versions of Windows that is largely cut off under Vista due to the window new border padding. With the default border padding of 4, the everything on the toolbar is shoved four pixels down and to the right, and then everything is cropped four pixels from the bottom and right sides. I don't really care about the horizontal dimension as much, but vertically this means the application loses eight pixels of visible content.
By "toolbar" I mean a window created similar to the following:
APPBARDATA AppBarData;
AppBarData.hWnd = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, MAIN_WNDCLASS,
"", WS_POPUP | WS_THICKFRAME | WS_CLIPCHILDREN,
0, 0, 400, TOOLBAR_HEIGHT, NULL, NULL,
AppInstance, NULL);
// more initialization ....
SHAppBarMessage(ABM_NEW, &AppBarData);
Since border padding is a configuration item seemingly new to Vista, how can an application that runs in both XP and Vista handle this? My questions are:
- Is it possible for a toolbar to tell Vista "Ignore the 'border padding' setting; my border padding is 0"?
- If not, how does an application figure out what the border padding is set to so it can make its window taller by twice that amount?
- For both questions, how do you do this in a way that allows the same executable to operate under XP, Vista, Win2003, and so on?