View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005262 | JEDI VCL | 00 JVCL Components | public | 2010-06-10 03:09 | 2011-06-10 16:10 |
Reporter | Moritz Beutel | Assigned To | obones | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | Daily / GIT | ||||
Target Version | Fixed in Version | 3.40 | |||
Summary | 0005262: NONCLIENTMETRICS size changes are not handled correctly | ||||
Description | A new Vista-specific field was added to the NONCLIENTMETRICS record in D2010. This means that SizeOf(NONCLIENTMETRICS) now yields a different value than before - which causes SystemParametersInfo() to fail on Win2k/XP/2003. The solution is to call the newly added class function 'NONCLIENTMETRICS.SizeOf' instead of directly using SizeOf(). NONCLIENTMETRICS is used throughout the JVCL, and most uses are broken without notice. But in one instance a workaround has been applied - in JvDockSupportProc.pas, by hard-coding the structure sizes: // ----- // Classic XP Era record sizes for TNONCLIENTMETRICSA or // TNONCLIENTMETRICSW {$ifdef UNICODE} JVDOCK_TNONCLIENTMETRICS_SZ = 500; // TNONCLIENTMETRICSW {$else} JVDOCK_TNONCLIENTMETRICS_SZ = 340; // TNONCLIENTMETRICSA {$endif} // ----- I don't think this is a good idea - it's going to fail again for Win64. I'd use this solution instead: // ----- function JvDockGetNoNClientMetrics: TNONCLIENTMETRICS; begin {$IFDEF COMPILER14_UP} Result.cbSize := TNONCLIENTMETRICS.SizeOf; {$ELSE} Result.cbSize := SizeOf(TNONCLIENTMETRICS); {$ENDIF} Win32Check (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, Result.cbSize, @Result, 0)); end; // ----- I've created patches (WinMerge, unified mode) which apply these fixes to the current revision of JVCL. | ||||
Tags | No tags attached. | ||||
2010-06-10 03:09
|
JVCL NONCLIENTMETRICS patches.zip (5,140 bytes) |
|
Thanks, this has now been committed in SVN |
Date Modified | Username | Field | Change |
---|---|---|---|
2010-06-10 03:09 | Moritz Beutel | New Issue | |
2010-06-10 03:09 | Moritz Beutel | File Added: JVCL NONCLIENTMETRICS patches.zip | |
2010-06-10 16:11 | obones | Note Added: 0017487 | |
2010-06-10 16:11 | obones | Status | new => resolved |
2010-06-10 16:11 | obones | Fixed in Version | => Daily / SVN |
2010-06-10 16:11 | obones | Resolution | open => fixed |
2010-06-10 16:11 | obones | Assigned To | => obones |
2011-06-10 16:10 | obones | Fixed in Version | Daily / SVN => 3.40 |