Added SPI_GETWINDOWSEXTENSION.
[wine] / windows / sysparams.c
1 /*
2  * System parameters functions
3  *
4  * Copyright 1994 Alexandre Julliard
5  */
6
7 #include "config.h"
8
9 #include <stdlib.h>
10 #include "windef.h"
11 #include "winbase.h"
12 #include "wingdi.h"
13 #include "winreg.h"
14 #include "wine/winuser16.h"
15 #include "wine/winestring.h"
16 #include "winerror.h"
17
18 #include "keyboard.h"
19 #include "tweak.h"
20 #include "user.h"
21 #include "desktop.h"
22 #include "debugtools.h"
23
24 DEFAULT_DEBUG_CHANNEL(system);
25
26 /***********************************************************************
27  *      GetTimerResolution (USER.14)
28  */
29 LONG WINAPI GetTimerResolution16(void)
30 {
31         return (1000);
32 }
33
34 /***********************************************************************
35  *      ControlPanelInfo16   (USER.273)
36  */
37 void WINAPI ControlPanelInfo16( INT16 nInfoType, WORD wData, LPSTR lpBuffer)
38 {
39         FIXME("(%d, %04x, %p): stub.\n", nInfoType, wData, lpBuffer);
40 }
41
42 /***********************************************************************
43  *      SystemParametersInfoA   (USER32.540)
44  */
45 BOOL WINAPI SystemParametersInfoA( UINT uAction, UINT uParam,
46                                        LPVOID lpvParam, UINT fuWinIni )
47 {
48         int timeout;
49
50         switch (uAction) {
51         case SPI_GETBEEP:
52                 *(BOOL *) lpvParam = KEYBOARD_GetBeepActive();
53                 break;
54         case SPI_SETBEEP:
55                KEYBOARD_SetBeepActive(uParam);
56                break;
57
58         case SPI_GETBORDER:
59                 *(INT *)lpvParam = GetSystemMetrics( SM_CXFRAME );
60                 break;
61
62         case SPI_GETDRAGFULLWINDOWS:
63                 *(BOOL *) lpvParam = FALSE;
64
65                 {
66                     HKEY hKey;
67                     char buffer[20];
68                     DWORD dwBufferSize = sizeof(buffer);
69
70                     if(RegOpenKeyExA(HKEY_CURRENT_USER,
71                             "Control Panel\\desktop",
72                             0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) {
73                         if(RegQueryValueExA(hKey, "DragFullWindows", NULL,
74                             0, buffer, &dwBufferSize) == ERROR_SUCCESS)
75                             *(BOOL *)lpvParam = atoi(buffer) != 0;
76
77                         RegCloseKey(hKey);
78                     }
79                 }
80                 break;
81
82         case SPI_SETDRAGFULLWINDOWS:
83                 break;
84
85         case SPI_GETFASTTASKSWITCH:
86                 if ( GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1 )
87                         *(BOOL *) lpvParam = TRUE;
88                 else
89                         *(BOOL *) lpvParam = FALSE;
90                 break;
91                 
92         case SPI_GETGRIDGRANULARITY:
93                 *(INT*)lpvParam=GetProfileIntA("desktop","GridGranularity",1);
94                 break;
95
96         case SPI_GETICONTITLEWRAP:
97                 *(BOOL*)lpvParam=GetProfileIntA("desktop","IconTitleWrap",TRUE);
98                 break;
99
100         case SPI_GETKEYBOARDDELAY:
101                 *(INT*)lpvParam=GetProfileIntA("keyboard","KeyboardDelay",1);
102                 break;
103
104         case SPI_GETKEYBOARDSPEED:
105                 *(DWORD*)lpvParam=GetProfileIntA("keyboard","KeyboardSpeed",30);
106                 break;
107
108         case SPI_GETMENUDROPALIGNMENT:
109                 *(BOOL*)lpvParam=GetSystemMetrics(SM_MENUDROPALIGNMENT); /* XXX check this */
110                 break;
111
112         case SPI_GETSCREENSAVEACTIVE:           
113                if(USER_Driver.pGetScreenSaveActive() || 
114                   GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1)
115                         *(BOOL*)lpvParam = TRUE;
116                 else
117                         *(BOOL*)lpvParam = FALSE;
118                 break;
119
120         case SPI_GETSCREENSAVETIMEOUT:
121                 timeout = USER_Driver.pGetScreenSaveTimeout();
122                 if(!timeout)
123                         timeout = GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
124                 *(INT *) lpvParam = timeout * 1000;
125                 break;
126
127         case SPI_ICONHORIZONTALSPACING:
128                 /* FIXME Get/SetProfileInt */
129                 if (lpvParam == NULL)
130                         /*SetSystemMetrics( SM_CXICONSPACING, uParam )*/ ;
131                 else
132                         *(INT*)lpvParam=GetSystemMetrics(SM_CXICONSPACING);
133                 break;
134
135         case SPI_ICONVERTICALSPACING:
136                 /* FIXME Get/SetProfileInt */
137                 if (lpvParam == NULL)
138                         /*SetSystemMetrics( SM_CYICONSPACING, uParam )*/ ;
139                 else
140                         *(INT*)lpvParam=GetSystemMetrics(SM_CYICONSPACING);
141                 break;
142
143         case SPI_GETICONTITLELOGFONT: {
144                 LPLOGFONTA lpLogFont = (LPLOGFONTA)lpvParam;
145
146                 /* from now on we always have an alias for MS Sans Serif */
147
148                 GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif", 
149                         lpLogFont->lfFaceName, LF_FACESIZE );
150                 lpLogFont->lfHeight = -GetProfileIntA("Desktop","IconTitleSize", 13);
151                 lpLogFont->lfWidth = 0;
152                 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
153                 lpLogFont->lfWeight = FW_NORMAL;
154                 lpLogFont->lfItalic = FALSE;
155                 lpLogFont->lfStrikeOut = FALSE;
156                 lpLogFont->lfUnderline = FALSE;
157                 lpLogFont->lfCharSet = ANSI_CHARSET;
158                 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
159                 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
160                 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
161                 break;
162         }
163
164         case SPI_GETICONMETRICS: {
165             LPICONMETRICSA lpIcon = lpvParam;
166             if(!lpIcon || lpIcon->cbSize != sizeof(*lpIcon))
167                 return FALSE;
168             SystemParametersInfoA( SPI_ICONHORIZONTALSPACING, 0,
169                                    &lpIcon->iHorzSpacing, FALSE );
170             SystemParametersInfoA( SPI_ICONVERTICALSPACING, 0,
171                                    &lpIcon->iVertSpacing, FALSE );
172             SystemParametersInfoA( SPI_GETICONTITLEWRAP, 0,
173                                    &lpIcon->iTitleWrap, FALSE );
174             SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0,
175                                    &lpIcon->lfFont, FALSE );
176             break;
177         }
178         case SPI_GETWORKAREA:
179                 SetRect( (RECT *)lpvParam, 0, 0,
180                         GetSystemMetrics( SM_CXSCREEN ),
181                         GetSystemMetrics( SM_CYSCREEN )
182                 );
183                 break;
184         case SPI_GETNONCLIENTMETRICS: 
185
186 #define lpnm ((LPNONCLIENTMETRICSA)lpvParam)
187                 
188                 if (lpnm->cbSize == sizeof(NONCLIENTMETRICSA))
189                 {
190                     LPLOGFONTA lpLogFont = &(lpnm->lfMenuFont);
191                 
192                     /* clear the struct, so we have 'sane' members */
193                     memset(
194                         (char*)lpvParam+sizeof(lpnm->cbSize),
195                         0,
196                         lpnm->cbSize-sizeof(lpnm->cbSize)
197                     );
198
199                     /* FIXME: initialize geometry entries */
200                     /* FIXME: As these values are presumably in device units,
201                      *  we should calculate the defaults based on the screen dpi
202                      */
203                     /* caption */
204                     lpnm->iCaptionWidth = ((TWEAK_WineLook > WIN31_LOOK)  ? 32 : 20);
205                     lpnm->iCaptionHeight = lpnm->iCaptionWidth;
206                     lpnm->lfCaptionFont.lfWeight = FW_BOLD;
207                     SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0, (LPVOID)&(lpnm->lfCaptionFont),0);
208
209                     /* small caption */
210                     lpnm->iSmCaptionWidth = ((TWEAK_WineLook > WIN31_LOOK)  ? 32 : 17);
211                     lpnm->iSmCaptionHeight = lpnm->iSmCaptionWidth;
212                     SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0, (LPVOID)&(lpnm->lfSmCaptionFont),0);
213
214                     /* menus, FIXME: names of wine.conf entrys are bogus */
215
216                     lpnm->iMenuWidth = GetProfileIntA("Desktop","MenuWidth", 13);       /* size of the menu buttons*/
217                     lpnm->iMenuHeight = GetProfileIntA("Desktop","MenuHeight", 
218                                                 (TWEAK_WineLook > WIN31_LOOK) ? 13 : 27);
219
220                     GetProfileStringA("Desktop", "MenuFont", 
221                         (TWEAK_WineLook > WIN31_LOOK) ? "MS Sans Serif": "System", 
222                         lpLogFont->lfFaceName, LF_FACESIZE );
223
224                     lpLogFont->lfHeight = -GetProfileIntA("Desktop","MenuFontSize", 13);
225                     lpLogFont->lfWidth = 0;
226                     lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
227                     lpLogFont->lfWeight = (TWEAK_WineLook > WIN31_LOOK) ? FW_NORMAL : FW_BOLD;
228                     lpLogFont->lfItalic = FALSE;
229                     lpLogFont->lfStrikeOut = FALSE;
230                     lpLogFont->lfUnderline = FALSE;
231                     lpLogFont->lfCharSet = ANSI_CHARSET;
232                     lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
233                     lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
234                     lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
235
236                     SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0,
237                                                         (LPVOID)&(lpnm->lfStatusFont),0);
238                     SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0,
239                                                         (LPVOID)&(lpnm->lfMessageFont),0);
240                 }
241                 else
242                 {
243                     WARN("size mismatch !! (is %d; should be %d)\n", lpnm->cbSize, sizeof(NONCLIENTMETRICSA));
244                     return FALSE;
245                 }
246 #undef lpnm
247                 break;
248
249         case SPI_GETANIMATION: {
250                 LPANIMATIONINFO lpAnimInfo = (LPANIMATIONINFO)lpvParam;
251  
252                 /* Tell it "disabled" */
253                 lpAnimInfo->cbSize = sizeof(ANIMATIONINFO);
254                 uParam = sizeof(ANIMATIONINFO);
255                 lpAnimInfo->iMinAnimate = 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
256                 break;
257         }
258  
259         case SPI_SETANIMATION: {
260                 LPANIMATIONINFO lpAnimInfo = (LPANIMATIONINFO)lpvParam;
261  
262                 /* Do nothing */
263                 WARN("SPI_SETANIMATION ignored.\n");
264                 lpAnimInfo->cbSize = sizeof(ANIMATIONINFO);
265                 uParam = sizeof(ANIMATIONINFO);
266                 break;
267         }
268
269         case SPI_GETHIGHCONTRAST:
270         {
271                 LPHIGHCONTRASTA lpHighContrastA = (LPHIGHCONTRASTA)lpvParam;
272
273                 FIXME("SPI_GETHIGHCONTRAST not fully implemented\n");
274
275                 if ( lpHighContrastA->cbSize == sizeof( HIGHCONTRASTA ) )
276                 {
277                         /* Indicate that there is no high contrast available */
278                         lpHighContrastA->dwFlags = 0;
279                         lpHighContrastA->lpszDefaultScheme = NULL;
280                 }
281                 else
282                 {
283                         return FALSE;
284                 }
285
286                 break;
287         }
288
289         default:
290                 return SystemParametersInfo16(uAction,uParam,lpvParam,fuWinIni);
291         }
292         return TRUE;
293 }
294
295
296 /***********************************************************************
297  *      SystemParametersInfo16   (USER.483)
298  */
299 BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam,
300                                       LPVOID lpvParam, UINT16 fuWinIni )
301 {
302         int timeout; 
303         char buffer[256];
304
305         switch (uAction)
306         {
307                 case SPI_GETBEEP:
308                         *(BOOL *) lpvParam = KEYBOARD_GetBeepActive();
309                         break;
310                 
311                 case SPI_GETBORDER:
312                         *(INT16 *)lpvParam = GetSystemMetrics( SM_CXFRAME );
313                         break;
314
315                 case SPI_GETFASTTASKSWITCH:
316                     if ( GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1 )
317                           *(BOOL16 *) lpvParam = TRUE;
318                         else
319                           *(BOOL16 *) lpvParam = FALSE;
320                         break;
321
322                 case SPI_GETGRIDGRANULARITY:
323                     *(INT16 *) lpvParam = GetProfileIntA( "desktop", 
324                                                           "GridGranularity",
325                                                           1 );
326                     break;
327
328                 case SPI_GETICONTITLEWRAP:
329                     *(BOOL16 *) lpvParam = GetProfileIntA( "desktop",
330                                                            "IconTitleWrap",
331                                                            TRUE );
332                     break;
333
334                 case SPI_GETKEYBOARDDELAY:
335                     *(INT16 *) lpvParam = GetProfileIntA( "keyboard",
336                                                           "KeyboardDelay", 1 );
337                     break;
338
339                 case SPI_GETKEYBOARDSPEED:
340                     *(WORD *) lpvParam = GetProfileIntA( "keyboard",
341                                                            "KeyboardSpeed",
342                                                            30 );
343                     break;
344
345                 case SPI_GETMENUDROPALIGNMENT:
346                         *(BOOL16 *) lpvParam = GetSystemMetrics( SM_MENUDROPALIGNMENT ); /* XXX check this */
347                         break;
348
349                 case SPI_GETSCREENSAVEACTIVE:
350                   if(USER_Driver.pGetScreenSaveActive() ||
351                      GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1)
352                         *(BOOL16 *) lpvParam = TRUE;
353                     else
354                         *(BOOL16 *) lpvParam = FALSE;
355                     break;
356
357                 case SPI_GETSCREENSAVETIMEOUT:
358                         timeout = USER_Driver.pGetScreenSaveTimeout();
359                         if(!timeout)
360                             timeout = GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
361                         *(INT16 *) lpvParam = timeout;
362                         break;
363
364                 case SPI_ICONHORIZONTALSPACING:
365                     /* FIXME Get/SetProfileInt */
366                         if (lpvParam == NULL)
367                             /*SetSystemMetrics( SM_CXICONSPACING, uParam )*/ ;
368                         else
369                             *(INT16 *)lpvParam = GetSystemMetrics( SM_CXICONSPACING );
370                         break;
371
372                 case SPI_ICONVERTICALSPACING:
373                     /* FIXME Get/SetProfileInt */
374                     if (lpvParam == NULL)
375                         /*SetSystemMetrics( SM_CYICONSPACING, uParam )*/ ;
376                     else
377                         *(INT16 *)lpvParam = GetSystemMetrics(SM_CYICONSPACING);
378                     break;
379
380                 case SPI_SETBEEP:
381                         KEYBOARD_SetBeepActive(uParam);
382                         break;
383
384                 case SPI_SETSCREENSAVEACTIVE:
385                         USER_Driver.pSetScreenSaveActive(uParam);
386                         break;
387
388                 case SPI_SETSCREENSAVETIMEOUT:
389                         USER_Driver.pSetScreenSaveTimeout(uParam);
390                         break;
391
392                 case SPI_SETDESKWALLPAPER:
393                         return (SetDeskWallPaper((LPSTR) lpvParam));
394                         break;
395
396                 case SPI_SETDESKPATTERN:
397                         if ((INT16)uParam == -1) {
398                                 GetProfileStringA("Desktop", "Pattern", 
399                                                 "170 85 170 85 170 85 170 85", 
400                                                 buffer, sizeof(buffer) );
401                                 return (DESKTOP_SetPattern((LPSTR) buffer));
402                         } else
403                                 return (DESKTOP_SetPattern((LPSTR) lpvParam));
404                         break;
405
406                 case SPI_GETICONTITLELOGFONT: 
407                 {
408                     LPLOGFONT16 lpLogFont = (LPLOGFONT16)lpvParam;
409                     GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif", 
410                                         lpLogFont->lfFaceName, LF_FACESIZE );
411                     lpLogFont->lfHeight = -GetProfileIntA("Desktop","IconTitleSize", 13);
412                     lpLogFont->lfWidth = 0;
413                     lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
414                     lpLogFont->lfWeight = FW_NORMAL;
415                     lpLogFont->lfItalic = FALSE;
416                     lpLogFont->lfStrikeOut = FALSE;
417                     lpLogFont->lfUnderline = FALSE;
418                     lpLogFont->lfCharSet = ANSI_CHARSET;
419                     lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
420                     lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
421                     lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
422                     break;
423                 }
424                 case SPI_GETNONCLIENTMETRICS:
425
426 #define lpnm ((LPNONCLIENTMETRICS16)lpvParam)
427                     if( lpnm->cbSize == sizeof(NONCLIENTMETRICS16) )
428                     {
429                         /* clear the struct, so we have 'sane' members */
430                         memset(
431                             (char*)lpvParam+sizeof(lpnm->cbSize),
432                             0,
433                             lpnm->cbSize-sizeof(lpnm->cbSize)
434                         );
435                         /* FIXME: initialize geometry entries */
436                         SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0, 
437                                                         (LPVOID)&(lpnm->lfCaptionFont),0);
438                         lpnm->lfCaptionFont.lfWeight = FW_BOLD;
439                         SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
440                                                         (LPVOID)&(lpnm->lfSmCaptionFont),0);
441                         SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
442                                                         (LPVOID)&(lpnm->lfMenuFont),0);
443                         SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
444                                                         (LPVOID)&(lpnm->lfStatusFont),0);
445                         SystemParametersInfo16( SPI_GETICONTITLELOGFONT, 0,
446                                                         (LPVOID)&(lpnm->lfMessageFont),0);
447                     }
448                     else /* winfile 95 sets sbSize to 340 */
449                         SystemParametersInfoA( uAction, uParam, lpvParam, fuWinIni );
450 #undef lpnm
451                     break;
452
453                 case SPI_LANGDRIVER:
454                 case SPI_SETBORDER:
455                 case SPI_SETDOUBLECLKHEIGHT:
456                 case SPI_SETDOUBLECLICKTIME:
457                 case SPI_SETDOUBLECLKWIDTH:
458                 case SPI_SETFASTTASKSWITCH:
459                 case SPI_SETKEYBOARDDELAY:
460                 case SPI_SETKEYBOARDSPEED:
461                         WARN("Option %d ignored.\n", uAction);
462                         break;
463
464                 case SPI_GETWINDOWSEXTENSION:
465                         WARN("pretend no support for Win9x Plus! for now.\n");
466                         return FALSE; /* yes, this is the result value */
467                         
468                 case SPI_GETWORKAREA:
469                     SetRect16( (RECT16 *)lpvParam, 0, 0,
470                                GetSystemMetrics( SM_CXSCREEN ),
471                                GetSystemMetrics( SM_CYSCREEN ) );
472                     break;
473
474                 /* FIXME need to implement SPI_SETMOUSEHOVER... */
475                 case SPI_GETMOUSEHOVERWIDTH:
476                     *(INT16 *)lpvParam = 4;
477                     break;
478
479                 case SPI_GETMOUSEHOVERHEIGHT:
480                     *(INT16 *)lpvParam = 4;
481                     break;
482
483                 case SPI_GETMOUSEHOVERTIME:
484                     *(INT16 *)lpvParam = 400; /* default for menu dropdowns */
485                     break;
486                 
487                 default:
488                         FIXME("Unknown option %d.\n", uAction);
489                         SetLastError(ERROR_INVALID_SPI_VALUE);
490                         return 0;
491         }
492         return 1;
493 }
494
495 /***********************************************************************
496  *      SystemParametersInfoW   (USER32.541)
497  */
498 BOOL WINAPI SystemParametersInfoW( UINT uAction, UINT uParam,
499                                        LPVOID lpvParam, UINT fuWinIni )
500 {
501     char buffer[256];
502
503     switch (uAction)
504     {
505     case SPI_SETDESKWALLPAPER:
506         if (lpvParam)
507         {
508             lstrcpynWtoA(buffer,(LPWSTR)lpvParam,sizeof(buffer));
509             return SetDeskWallPaper(buffer);
510         }
511         return SetDeskWallPaper(NULL);
512
513     case SPI_SETDESKPATTERN:
514         if ((INT) uParam == -1)
515         {
516             GetProfileStringA("Desktop", "Pattern", 
517                                 "170 85 170 85 170 85 170 85", 
518                                 buffer, sizeof(buffer) );
519             return (DESKTOP_SetPattern((LPSTR) buffer));
520         }
521         if (lpvParam)
522         {
523             lstrcpynWtoA(buffer,(LPWSTR)lpvParam,sizeof(buffer));
524             return DESKTOP_SetPattern(buffer);
525         }
526         return DESKTOP_SetPattern(NULL);
527
528     case SPI_GETICONTITLELOGFONT:
529         {
530             LPLOGFONTW lpLogFont = (LPLOGFONTW)lpvParam;
531
532             GetProfileStringA("Desktop", "IconTitleFaceName", "MS Sans Serif", 
533                          buffer, sizeof(buffer) );
534             lstrcpynAtoW(lpLogFont->lfFaceName, buffer, LF_FACESIZE);
535             lpLogFont->lfHeight = 17;
536             lpLogFont->lfWidth = 0;
537             lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
538             lpLogFont->lfWeight = FW_NORMAL;
539             lpLogFont->lfItalic = lpLogFont->lfStrikeOut = lpLogFont->lfUnderline = FALSE;
540             lpLogFont->lfCharSet = ANSI_CHARSET;
541             lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
542             lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
543             lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
544         }
545         break;
546         case SPI_GETICONMETRICS: {
547             LPICONMETRICSW lpIcon = lpvParam;
548             if(!lpIcon || lpIcon->cbSize != sizeof(*lpIcon))
549                 return FALSE;
550             SystemParametersInfoW( SPI_ICONHORIZONTALSPACING, 0,
551                                    &lpIcon->iHorzSpacing, FALSE );
552             SystemParametersInfoW( SPI_ICONVERTICALSPACING, 0,
553                                    &lpIcon->iVertSpacing, FALSE );
554             SystemParametersInfoW( SPI_GETICONTITLEWRAP, 0,
555                                    &lpIcon->iTitleWrap, FALSE );
556             SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0,
557                                    &lpIcon->lfFont, FALSE );
558             break;
559         }
560     case SPI_GETNONCLIENTMETRICS: {
561         /* FIXME: implement correctly */
562         LPNONCLIENTMETRICSW     lpnm=(LPNONCLIENTMETRICSW)lpvParam;
563
564         /* clear the struct, so we have 'sane' members */
565         memset((char*)lpvParam+sizeof(lpnm->cbSize),
566                 0,
567                 lpnm->cbSize-sizeof(lpnm->cbSize)
568         );
569         SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfCaptionFont),0);
570         lpnm->lfCaptionFont.lfWeight = FW_BOLD;
571         SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfSmCaptionFont),0);
572         SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfMenuFont),0);
573         SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfStatusFont),0);
574         SystemParametersInfoW(SPI_GETICONTITLELOGFONT,0,(LPVOID)&(lpnm->lfMessageFont),0);
575         break;
576     }
577
578     case SPI_GETHIGHCONTRAST:
579     {
580        LPHIGHCONTRASTW lpHighContrastW = (LPHIGHCONTRASTW)lpvParam;
581
582        FIXME("SPI_GETHIGHCONTRAST not fully implemented\n");
583
584        if ( lpHighContrastW->cbSize == sizeof( HIGHCONTRASTW ) )
585        {
586           /* Indicate that there is no high contrast available */
587           lpHighContrastW->dwFlags = 0;
588           lpHighContrastW->lpszDefaultScheme = NULL;
589        }
590        else
591        {
592           return FALSE;
593        }
594
595        break;
596     }
597
598     default:
599         return SystemParametersInfoA(uAction,uParam,lpvParam,fuWinIni);
600         
601     }
602     return TRUE;
603 }