Discussion:
SystemParametersInfo
(too old to reply)
Piet
2008-09-29 09:46:39 UTC
Permalink
I'm using SystemParametersInfo to get scrollwidth for use with a
stringgrid:

NONCLIENTMETRICS ncmStruct;

// find scrollbar width
ncmStruct.cbSize = sizeof(NONCLIENTMETRICS);
// get current non-client window metrics
SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
sizeof(NONCLIENTMETRICS),
&ncmStruct,
0);
sgEvents->DefaultColWidth = sgEvents->Width - m_ScrollWidth;

This has always worked well with previous versions of Builder, but
with C++Builder 2007 it only gives the proper value with a debug
build. A release build gives 0 (also for iCaptionHeight). Library
paths are the same except $(BDS)\lib\debug for debug and $(BDS)\lib
\release for release. Conditional defines _DEBUG;NO_STRICT and
NDEBUG;NO_STRICT respectively. Dynamic RTL and Runtime packages
unchecked.

Any ideas?
Piet
Piet
2008-10-02 10:03:36 UTC
Permalink
I've found a solution (sort of); check cppbuilder.migration group.
Piet

Loading...