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:
one option is to play with different window styles, starting with WS_THICKFRAME.
to figure out the padding try using GetClientRect and GetWindowRect and subtract one from the other.