Author: gadamopoulos
Date: Tue Oct 18 11:19:24 2011
New Revision: 54187
URL:
http://svn.reactos.org/svn/reactos?rev=54187&view=rev
Log:
[user32_apitest]
- Add one more testcase and fix another one for SPI_SETNONCLIENTMETRICS
Modified:
trunk/rostests/apitests/user32/SystemParametersInfo.c
Modified: trunk/rostests/apitests/user32/SystemParametersInfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/SystemPar…
==============================================================================
--- trunk/rostests/apitests/user32/SystemParametersInfo.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/user32/SystemParametersInfo.c [iso-8859-1] Tue Oct 18 11:19:24
2011
@@ -64,11 +64,24 @@
{2,WM_WINDOWPOSCHANGING, SENT, 0,
SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW},
{2,WM_GETMINMAXINFO},
{2,WM_NCCALCSIZE},
- {2,WM_WINDOWPOSCHANGED, SENT, 0,
SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW |
SWP_NOCLIENTSIZE},
+ {2,WM_WINDOWPOSCHANGED, SENT, 0,
SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW |
SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | SWP_NOSIZE},
{1,WM_WINDOWPOSCHANGING, SENT, 0,
SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW},
{1,WM_GETMINMAXINFO},
{1,WM_NCCALCSIZE},
- {1,WM_WINDOWPOSCHANGED, SENT, 0,
SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW |
SWP_NOCLIENTSIZE},
+ {1,WM_WINDOWPOSCHANGED, SENT, 0,
SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW |
SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | SWP_NOSIZE},
+ {0,0}};
+
+MSG_ENTRY NcMetricsChange1_chain[]={
+ {2,WM_WINDOWPOSCHANGING, SENT, 0,
SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW},
+ {2,WM_GETMINMAXINFO},
+ {2,WM_NCCALCSIZE},
+ {2,WM_WINDOWPOSCHANGED, SENT, 0,
SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW |
SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | SWP_NOSIZE},
+ {1,WM_WINDOWPOSCHANGING, SENT, 0,
SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW},
+ {1,WM_GETMINMAXINFO},
+ {1,WM_NCCALCSIZE},
+ {1,WM_WINDOWPOSCHANGED, SENT, 0,
SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW |
SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | SWP_NOSIZE},
+ {2,WM_SETTINGCHANGE},
+ {1,WM_SETTINGCHANGE},
{0,0}};
MSG_ENTRY CaptionHeight_chain[]={
@@ -80,7 +93,7 @@
{1,WM_WINDOWPOSCHANGING, SENT, 0,
SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW},
{1,WM_GETMINMAXINFO},
{1,WM_NCCALCSIZE},
- {1,WM_WINDOWPOSCHANGED, SENT, 0,
SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW |
SWP_NOCLIENTSIZE},
+ {1,WM_WINDOWPOSCHANGED, SENT, 0,
SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW |
SWP_NOCLIENTSIZE},
{1,WM_MOVE},
{0,0}};
@@ -88,21 +101,33 @@
{
NONCLIENTMETRICS NonClientMetrics;
+ /* WARNING: this test requires themes and dwm to be disabled */
+
SetCursorPos(0,0);
+ /* Retrieve th non client metrics */
NonClientMetrics.cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS),
&NonClientMetrics, 0);
FlushMessages();
COMPARE_CACHE(empty_chain);
+
+ /* Set the non client metric without making any change */
SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS),
&NonClientMetrics, 0);
FlushMessages();
COMPARE_CACHE(NcMetricsChange_chain);
+ /* Set the same metrics again with the SPIF_SENDCHANGE param */
+ SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS),
&NonClientMetrics, SPIF_SENDCHANGE|SPIF_UPDATEINIFILE );
+ FlushMessages();
+ COMPARE_CACHE(NcMetricsChange1_chain);
+
+ /* Slightly change the caption height */
NonClientMetrics.iCaptionHeight += 1;
SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS),
&NonClientMetrics, 0);
FlushMessages();
COMPARE_CACHE(CaptionHeight_chain);
+ /* Restore the original caption height */
NonClientMetrics.iCaptionHeight -= 1;
SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS),
&NonClientMetrics, 0);
FlushMessages();