2000-03-18 23:12:33 +01:00
|
|
|
/*
|
|
|
|
* System parameters functions
|
|
|
|
*
|
|
|
|
* Copyright 1994 Alexandre Julliard
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2000-03-18 23:12:33 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2004-12-09 14:48:56 +01:00
|
|
|
#include <assert.h>
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2001-11-07 21:24:29 +01:00
|
|
|
#include <stdio.h>
|
2000-08-14 19:20:25 +02:00
|
|
|
#include <stdlib.h>
|
2001-01-26 21:43:40 +01:00
|
|
|
#include <string.h>
|
2007-11-05 12:35:10 +01:00
|
|
|
|
|
|
|
#define NONAMELESSUNION
|
|
|
|
#define NONAMELESSSTRUCT
|
|
|
|
|
2000-03-18 23:12:33 +01:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
2000-11-28 23:40:56 +01:00
|
|
|
#include "winnls.h"
|
2000-03-18 23:12:33 +01:00
|
|
|
#include "wingdi.h"
|
2000-08-14 19:20:25 +02:00
|
|
|
#include "winreg.h"
|
2009-12-11 20:59:04 +01:00
|
|
|
#include "wine/wingdi16.h"
|
2000-03-18 23:12:33 +01:00
|
|
|
#include "winerror.h"
|
|
|
|
|
2000-12-11 00:01:33 +01:00
|
|
|
#include "controls.h"
|
2004-12-08 19:06:14 +01:00
|
|
|
#include "user_private.h"
|
2012-05-31 11:44:23 +02:00
|
|
|
#include "wine/gdi_driver.h"
|
2004-03-04 02:41:11 +01:00
|
|
|
#include "wine/unicode.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2000-03-18 23:12:33 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(system);
|
2000-03-18 23:12:33 +01:00
|
|
|
|
2001-11-07 21:24:29 +01:00
|
|
|
/* System parameter indexes */
|
2005-07-15 18:35:27 +02:00
|
|
|
enum spi_index
|
|
|
|
{
|
|
|
|
SPI_SETWORKAREA_IDX,
|
|
|
|
SPI_INDEX_COUNT
|
|
|
|
};
|
2001-11-07 21:24:29 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Names of the registry subkeys of HKEY_CURRENT_USER key and value names
|
|
|
|
* for the system parameters.
|
|
|
|
*/
|
2012-11-16 12:22:31 +01:00
|
|
|
|
|
|
|
/* the various registry keys that are used to store parameters */
|
|
|
|
enum parameter_key
|
|
|
|
{
|
2012-11-19 15:18:44 +01:00
|
|
|
COLORS_KEY,
|
2012-11-16 12:22:31 +01:00
|
|
|
DESKTOP_KEY,
|
|
|
|
KEYBOARD_KEY,
|
|
|
|
MOUSE_KEY,
|
|
|
|
METRICS_KEY,
|
|
|
|
SOUND_KEY,
|
|
|
|
VERSION_KEY,
|
|
|
|
SHOWSOUNDS_KEY,
|
|
|
|
KEYBOARDPREF_KEY,
|
|
|
|
SCREENREADER_KEY,
|
|
|
|
NB_PARAM_KEYS
|
|
|
|
};
|
|
|
|
|
2012-11-19 15:18:44 +01:00
|
|
|
static const WCHAR COLORS_REGKEY[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','C','o','l','o','r','s',0};
|
2012-11-13 16:09:22 +01:00
|
|
|
static const WCHAR DESKTOP_REGKEY[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
|
|
|
|
static const WCHAR KEYBOARD_REGKEY[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','K','e','y','b','o','a','r','d',0};
|
|
|
|
static const WCHAR MOUSE_REGKEY[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
|
|
|
|
static const WCHAR METRICS_REGKEY[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p','\\',
|
|
|
|
'W','i','n','d','o','w','M','e','t','r','i','c','s',0};
|
2012-11-16 12:22:31 +01:00
|
|
|
static const WCHAR SOUND_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','S','o','u','n','d',0};
|
|
|
|
static const WCHAR VERSION_REGKEY[] = {'S','o','f','t','w','a','r','e','\\',
|
|
|
|
'M','i','c','r','o','s','o','f','t','\\',
|
|
|
|
'W','i','n','d','o','w','s',' ','N','T','\\',
|
|
|
|
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
|
|
|
|
'W','i','n','d','o','w','s',0};
|
|
|
|
static const WCHAR SHOWSOUNDS_REGKEY[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
|
|
|
|
'A','c','c','e','s','s','i','b','i','l','i','t','y','\\',
|
|
|
|
'S','h','o','w','S','o','u','n','d','s',0};
|
|
|
|
static const WCHAR KEYBOARDPREF_REGKEY[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
|
|
|
|
'A','c','c','e','s','s','i','b','i','l','i','t','y','\\',
|
|
|
|
'K','e','y','b','o','a','r','d',' ','P','r','e','f','e','r','e','n','c','e',0};
|
|
|
|
static const WCHAR SCREENREADER_REGKEY[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
|
|
|
|
'A','c','c','e','s','s','i','b','i','l','i','t','y','\\',
|
|
|
|
'B','l','i','n','d',' ','A','c','c','e','s','s',0};
|
|
|
|
|
|
|
|
static const WCHAR *parameter_key_names[NB_PARAM_KEYS] =
|
|
|
|
{
|
2012-11-19 15:18:44 +01:00
|
|
|
COLORS_REGKEY,
|
2012-11-16 12:22:31 +01:00
|
|
|
DESKTOP_REGKEY,
|
|
|
|
KEYBOARD_REGKEY,
|
|
|
|
MOUSE_REGKEY,
|
|
|
|
METRICS_REGKEY,
|
|
|
|
SOUND_REGKEY,
|
|
|
|
VERSION_REGKEY,
|
|
|
|
SHOWSOUNDS_REGKEY,
|
|
|
|
KEYBOARDPREF_REGKEY,
|
|
|
|
SCREENREADER_REGKEY,
|
|
|
|
};
|
2012-11-13 16:09:22 +01:00
|
|
|
|
2012-11-16 12:22:31 +01:00
|
|
|
/* parameter key values; the first char is actually an enum parameter_key to specify the key */
|
|
|
|
static const WCHAR BEEP_VALNAME[]= {SOUND_KEY,'B','e','e','p',0};
|
|
|
|
static const WCHAR MOUSETHRESHOLD1_VALNAME[]= {MOUSE_KEY,'M','o','u','s','e','T','h','r','e','s','h','o','l','d','1',0};
|
|
|
|
static const WCHAR MOUSETHRESHOLD2_VALNAME[]= {MOUSE_KEY,'M','o','u','s','e','T','h','r','e','s','h','o','l','d','2',0};
|
|
|
|
static const WCHAR MOUSEACCELERATION_VALNAME[]= {MOUSE_KEY,'M','o','u','s','e','S','p','e','e','d',0};
|
|
|
|
static const WCHAR BORDER_VALNAME[]= {METRICS_KEY,'B','o','r','d','e','r','W','i','d','t','h',0};
|
|
|
|
static const WCHAR KEYBOARDSPEED_VALNAME[]= {KEYBOARD_KEY,'K','e','y','b','o','a','r','d','S','p','e','e','d',0};
|
|
|
|
static const WCHAR ICONHORIZONTALSPACING_VALNAME[]= {METRICS_KEY,'I','c','o','n','S','p','a','c','i','n','g',0};
|
|
|
|
static const WCHAR SCREENSAVETIMEOUT_VALNAME[]= {DESKTOP_KEY,'S','c','r','e','e','n','S','a','v','e','T','i','m','e','O','u','t',0};
|
|
|
|
static const WCHAR SCREENSAVEACTIVE_VALNAME[]= {DESKTOP_KEY,'S','c','r','e','e','n','S','a','v','e','A','c','t','i','v','e',0};
|
|
|
|
static const WCHAR GRIDGRANULARITY_VALNAME[]= {DESKTOP_KEY,'G','r','i','d','G','r','a','n','u','l','a','r','i','t','y',0};
|
|
|
|
static const WCHAR KEYBOARDDELAY_VALNAME[]= {KEYBOARD_KEY,'K','e','y','b','o','a','r','d','D','e','l','a','y',0};
|
|
|
|
static const WCHAR ICONVERTICALSPACING_VALNAME[]= {METRICS_KEY,'I','c','o','n','V','e','r','t','i','c','a','l','S','p','a','c','i','n','g',0};
|
|
|
|
static const WCHAR ICONTITLEWRAP_VALNAME[]= {DESKTOP_KEY,'I','c','o','n','T','i','t','l','e','W','r','a','p',0};
|
|
|
|
static const WCHAR ICONTITLEWRAP_MIRROR[]= {METRICS_KEY,'I','c','o','n','T','i','t','l','e','W','r','a','p',0};
|
|
|
|
static const WCHAR ICONTITLELOGFONT_VALNAME[]= {METRICS_KEY,'I','c','o','n','F','o','n','t',0};
|
|
|
|
static const WCHAR MENUDROPALIGNMENT_VALNAME[]= {DESKTOP_KEY,'M','e','n','u','D','r','o','p','A','l','i','g','n','m','e','n','t',0};
|
|
|
|
static const WCHAR MENUDROPALIGNMENT_MIRROR[]= {VERSION_KEY,'M','e','n','u','D','r','o','p','A','l','i','g','n','m','e','n','t',0};
|
|
|
|
static const WCHAR MOUSETRAILS_VALNAME[]= {MOUSE_KEY,'M','o','u','s','e','T','r','a','i','l','s',0};
|
|
|
|
static const WCHAR SNAPTODEFBUTTON_VALNAME[]= {MOUSE_KEY,'S','n','a','p','T','o','D','e','f','a','u','l','t','B','u','t','t','o','n',0};
|
|
|
|
static const WCHAR DOUBLECLKWIDTH_VALNAME[]= {MOUSE_KEY,'D','o','u','b','l','e','C','l','i','c','k','W','i','d','t','h',0};
|
|
|
|
static const WCHAR DOUBLECLKWIDTH_MIRROR[]= {DESKTOP_KEY,'D','o','u','b','l','e','C','l','i','c','k','W','i','d','t','h',0};
|
|
|
|
static const WCHAR DOUBLECLKHEIGHT_VALNAME[]= {MOUSE_KEY,'D','o','u','b','l','e','C','l','i','c','k','H','e','i','g','h','t',0};
|
|
|
|
static const WCHAR DOUBLECLKHEIGHT_MIRROR[]= {DESKTOP_KEY,'D','o','u','b','l','e','C','l','i','c','k','H','e','i','g','h','t',0};
|
|
|
|
static const WCHAR DOUBLECLICKTIME_VALNAME[]= {MOUSE_KEY,'D','o','u','b','l','e','C','l','i','c','k','S','p','e','e','d',0};
|
|
|
|
static const WCHAR MOUSEBUTTONSWAP_VALNAME[]= {MOUSE_KEY,'S','w','a','p','M','o','u','s','e','B','u','t','t','o','n','s',0};
|
|
|
|
static const WCHAR DRAGFULLWINDOWS_VALNAME[]= {DESKTOP_KEY,'D','r','a','g','F','u','l','l','W','i','n','d','o','w','s',0};
|
|
|
|
static const WCHAR SHOWSOUNDS_VALNAME[]= {SHOWSOUNDS_KEY,'O','n',0};
|
|
|
|
static const WCHAR KEYBOARDPREF_VALNAME[]= {KEYBOARDPREF_KEY,'O','n',0};
|
|
|
|
static const WCHAR SCREENREADER_VALNAME[]= {SCREENREADER_KEY,'O','n',0};
|
|
|
|
static const WCHAR DESKWALLPAPER_VALNAME[]= {DESKTOP_KEY,'W','a','l','l','p','a','p','e','r',0};
|
|
|
|
static const WCHAR DESKPATTERN_VALNAME[]= {DESKTOP_KEY,'P','a','t','t','e','r','n',0};
|
|
|
|
static const WCHAR FONTSMOOTHING_VALNAME[]= {DESKTOP_KEY,'F','o','n','t','S','m','o','o','t','h','i','n','g',0};
|
|
|
|
static const WCHAR DRAGWIDTH_VALNAME[]= {DESKTOP_KEY,'D','r','a','g','W','i','d','t','h',0};
|
|
|
|
static const WCHAR DRAGHEIGHT_VALNAME[]= {DESKTOP_KEY,'D','r','a','g','H','e','i','g','h','t',0};
|
|
|
|
static const WCHAR LOWPOWERACTIVE_VALNAME[]= {DESKTOP_KEY,'L','o','w','P','o','w','e','r','A','c','t','i','v','e',0};
|
|
|
|
static const WCHAR POWEROFFACTIVE_VALNAME[]= {DESKTOP_KEY,'P','o','w','e','r','O','f','f','A','c','t','i','v','e',0};
|
|
|
|
static const WCHAR USERPREFERENCESMASK_VALNAME[]= {DESKTOP_KEY,'U','s','e','r','P','r','e','f','e','r','e','n','c','e','s','M','a','s','k',0};
|
|
|
|
static const WCHAR MOUSEHOVERWIDTH_VALNAME[]= {MOUSE_KEY,'M','o','u','s','e','H','o','v','e','r','W','i','d','t','h',0};
|
|
|
|
static const WCHAR MOUSEHOVERHEIGHT_VALNAME[]= {MOUSE_KEY,'M','o','u','s','e','H','o','v','e','r','H','e','i','g','h','t',0};
|
|
|
|
static const WCHAR MOUSEHOVERTIME_VALNAME[]= {MOUSE_KEY,'M','o','u','s','e','H','o','v','e','r','T','i','m','e',0};
|
|
|
|
static const WCHAR WHEELSCROLLCHARS_VALNAME[]= {DESKTOP_KEY,'W','h','e','e','l','S','c','r','o','l','l','C','h','a','r','s',0};
|
|
|
|
static const WCHAR WHEELSCROLLLINES_VALNAME[]= {DESKTOP_KEY,'W','h','e','e','l','S','c','r','o','l','l','L','i','n','e','s',0};
|
|
|
|
static const WCHAR ACTIVEWINDOWTRACKING_VALNAME[]= {MOUSE_KEY,'A','c','t','i','v','e','W','i','n','d','o','w','T','r','a','c','k','i','n','g',0};
|
|
|
|
static const WCHAR MENUSHOWDELAY_VALNAME[]= {DESKTOP_KEY,'M','e','n','u','S','h','o','w','D','e','l','a','y',0};
|
|
|
|
static const WCHAR BLOCKSENDINPUTRESETS_VALNAME[]= {DESKTOP_KEY,'B','l','o','c','k','S','e','n','d','I','n','p','u','t','R','e','s','e','t','s',0};
|
|
|
|
static const WCHAR FOREGROUNDLOCKTIMEOUT_VALNAME[]= {DESKTOP_KEY,'F','o','r','e','g','r','o','u','n','d','L','o','c','k','T','i','m','e','o','u','t',0};
|
|
|
|
static const WCHAR ACTIVEWNDTRKTIMEOUT_VALNAME[]= {DESKTOP_KEY,'A','c','t','i','v','e','W','n','d','T','r','a','c','k','T','i','m','e','o','u','t',0};
|
|
|
|
static const WCHAR FOREGROUNDFLASHCOUNT_VALNAME[]= {DESKTOP_KEY,'F','o','r','e','g','r','o','u','n','d','F','l','a','s','h','C','o','u','n','t',0};
|
|
|
|
static const WCHAR CARETWIDTH_VALNAME[]= {DESKTOP_KEY,'C','a','r','e','t','W','i','d','t','h',0};
|
|
|
|
static const WCHAR MOUSECLICKLOCKTIME_VALNAME[]= {DESKTOP_KEY,'C','l','i','c','k','L','o','c','k','T','i','m','e',0};
|
|
|
|
static const WCHAR MOUSESPEED_VALNAME[]= {MOUSE_KEY,'M','o','u','s','e','S','e','n','s','i','t','i','v','i','t','y',0};
|
|
|
|
static const WCHAR FONTSMOOTHINGTYPE_VALNAME[]= {DESKTOP_KEY,'F','o','n','t','S','m','o','o','t','h','i','n','g','T','y','p','e',0};
|
|
|
|
static const WCHAR FONTSMOOTHINGCONTRAST_VALNAME[]= {DESKTOP_KEY,'F','o','n','t','S','m','o','o','t','h','i','n','g','G','a','m','m','a',0};
|
|
|
|
static const WCHAR FONTSMOOTHINGORIENTATION_VALNAME[]= {DESKTOP_KEY,'F','o','n','t','S','m','o','o','t','h','i','n','g','O','r','i','e','n','t','a','t','i','o','n',0};
|
|
|
|
static const WCHAR FOCUSBORDERWIDTH_VALNAME[]= {DESKTOP_KEY,'F','o','c','u','s','B','o','r','d','e','r','W','i','d','t','h',0};
|
|
|
|
static const WCHAR FOCUSBORDERHEIGHT_VALNAME[]= {DESKTOP_KEY,'F','o','c','u','s','B','o','r','d','e','r','H','e','i','g','h','t',0};
|
|
|
|
static const WCHAR SCROLLWIDTH_VALNAME[]= {METRICS_KEY,'S','c','r','o','l','l','W','i','d','t','h',0};
|
|
|
|
static const WCHAR SCROLLHEIGHT_VALNAME[]= {METRICS_KEY,'S','c','r','o','l','l','H','e','i','g','h','t',0};
|
|
|
|
static const WCHAR CAPTIONWIDTH_VALNAME[]= {METRICS_KEY,'C','a','p','t','i','o','n','W','i','d','t','h',0};
|
|
|
|
static const WCHAR CAPTIONHEIGHT_VALNAME[]= {METRICS_KEY,'C','a','p','t','i','o','n','H','e','i','g','h','t',0};
|
|
|
|
static const WCHAR SMCAPTIONWIDTH_VALNAME[]= {METRICS_KEY,'S','m','C','a','p','t','i','o','n','W','i','d','t','h',0};
|
|
|
|
static const WCHAR SMCAPTIONHEIGHT_VALNAME[]= {METRICS_KEY,'S','m','C','a','p','t','i','o','n','H','e','i','g','h','t',0};
|
|
|
|
static const WCHAR MENUWIDTH_VALNAME[]= {METRICS_KEY,'M','e','n','u','W','i','d','t','h',0};
|
|
|
|
static const WCHAR MENUHEIGHT_VALNAME[]= {METRICS_KEY,'M','e','n','u','H','e','i','g','h','t',0};
|
|
|
|
static const WCHAR ICONSIZE_VALNAME[]= {METRICS_KEY,'S','h','e','l','l',' ','I','c','o','n',' ','S','i','z','e',0};
|
|
|
|
static const WCHAR PADDEDBORDERWIDTH_VALNAME[]= {METRICS_KEY,'P','a','d','d','e','d','B','o','r','d','e','r','W','i','d','t','h',0};
|
|
|
|
static const WCHAR CAPTIONLOGFONT_VALNAME[]= {METRICS_KEY,'C','a','p','t','i','o','n','F','o','n','t',0};
|
|
|
|
static const WCHAR SMCAPTIONLOGFONT_VALNAME[]= {METRICS_KEY,'S','m','C','a','p','t','i','o','n','F','o','n','t',0};
|
|
|
|
static const WCHAR MENULOGFONT_VALNAME[]= {METRICS_KEY,'M','e','n','u','F','o','n','t',0};
|
|
|
|
static const WCHAR MESSAGELOGFONT_VALNAME[]= {METRICS_KEY,'M','e','s','s','a','g','e','F','o','n','t',0};
|
|
|
|
static const WCHAR STATUSLOGFONT_VALNAME[]= {METRICS_KEY,'S','t','a','t','u','s','F','o','n','t',0};
|
|
|
|
static const WCHAR MINWIDTH_VALNAME[] = {METRICS_KEY,'M','i','n','W','i','d','t','h',0};
|
|
|
|
static const WCHAR MINHORZGAP_VALNAME[] = {METRICS_KEY,'M','i','n','H','o','r','z','G','a','p',0};
|
|
|
|
static const WCHAR MINVERTGAP_VALNAME[] = {METRICS_KEY,'M','i','n','V','e','r','t','G','a','p',0};
|
|
|
|
static const WCHAR MINARRANGE_VALNAME[] = {METRICS_KEY,'M','i','n','A','r','r','a','n','g','e',0};
|
2012-11-19 15:18:44 +01:00
|
|
|
static const WCHAR COLOR_SCROLLBAR_VALNAME[] = {COLORS_KEY,'S','c','r','o','l','l','b','a','r',0};
|
|
|
|
static const WCHAR COLOR_BACKGROUND_VALNAME[] = {COLORS_KEY,'B','a','c','k','g','r','o','u','n','d',0};
|
|
|
|
static const WCHAR COLOR_ACTIVECAPTION_VALNAME[] = {COLORS_KEY,'A','c','t','i','v','e','T','i','t','l','e',0};
|
|
|
|
static const WCHAR COLOR_INACTIVECAPTION_VALNAME[] = {COLORS_KEY,'I','n','a','c','t','i','v','e','T','i','t','l','e',0};
|
|
|
|
static const WCHAR COLOR_MENU_VALNAME[] = {COLORS_KEY,'M','e','n','u',0};
|
|
|
|
static const WCHAR COLOR_WINDOW_VALNAME[] = {COLORS_KEY,'W','i','n','d','o','w',0};
|
|
|
|
static const WCHAR COLOR_WINDOWFRAME_VALNAME[] = {COLORS_KEY,'W','i','n','d','o','w','F','r','a','m','e',0};
|
|
|
|
static const WCHAR COLOR_MENUTEXT_VALNAME[] = {COLORS_KEY,'M','e','n','u','T','e','x','t',0};
|
|
|
|
static const WCHAR COLOR_WINDOWTEXT_VALNAME[] = {COLORS_KEY,'W','i','n','d','o','w','T','e','x','t',0};
|
|
|
|
static const WCHAR COLOR_CAPTIONTEXT_VALNAME[] = {COLORS_KEY,'T','i','t','l','e','T','e','x','t',0};
|
|
|
|
static const WCHAR COLOR_ACTIVEBORDER_VALNAME[] = {COLORS_KEY,'A','c','t','i','v','e','B','o','r','d','e','r',0};
|
|
|
|
static const WCHAR COLOR_INACTIVEBORDER_VALNAME[] = {COLORS_KEY,'I','n','a','c','t','i','v','e','B','o','r','d','e','r',0};
|
|
|
|
static const WCHAR COLOR_APPWORKSPACE_VALNAME[] = {COLORS_KEY,'A','p','p','W','o','r','k','S','p','a','c','e',0};
|
|
|
|
static const WCHAR COLOR_HIGHLIGHT_VALNAME[] = {COLORS_KEY,'H','i','l','i','g','h','t',0};
|
|
|
|
static const WCHAR COLOR_HIGHLIGHTTEXT_VALNAME[] = {COLORS_KEY,'H','i','l','i','g','h','t','T','e','x','t',0};
|
|
|
|
static const WCHAR COLOR_BTNFACE_VALNAME[] = {COLORS_KEY,'B','u','t','t','o','n','F','a','c','e',0};
|
|
|
|
static const WCHAR COLOR_BTNSHADOW_VALNAME[] = {COLORS_KEY,'B','u','t','t','o','n','S','h','a','d','o','w',0};
|
|
|
|
static const WCHAR COLOR_GRAYTEXT_VALNAME[] = {COLORS_KEY,'G','r','a','y','T','e','x','t',0};
|
|
|
|
static const WCHAR COLOR_BTNTEXT_VALNAME[] = {COLORS_KEY,'B','u','t','t','o','n','T','e','x','t',0};
|
|
|
|
static const WCHAR COLOR_INACTIVECAPTIONTEXT_VALNAME[] = {COLORS_KEY,'I','n','a','c','t','i','v','e','T','i','t','l','e','T','e','x','t',0};
|
|
|
|
static const WCHAR COLOR_BTNHIGHLIGHT_VALNAME[] = {COLORS_KEY,'B','u','t','t','o','n','H','i','l','i','g','h','t',0};
|
|
|
|
static const WCHAR COLOR_3DDKSHADOW_VALNAME[] = {COLORS_KEY,'B','u','t','t','o','n','D','k','S','h','a','d','o','w',0};
|
|
|
|
static const WCHAR COLOR_3DLIGHT_VALNAME[] = {COLORS_KEY,'B','u','t','t','o','n','L','i','g','h','t',0};
|
|
|
|
static const WCHAR COLOR_INFOTEXT_VALNAME[] = {COLORS_KEY,'I','n','f','o','T','e','x','t',0};
|
|
|
|
static const WCHAR COLOR_INFOBK_VALNAME[] = {COLORS_KEY,'I','n','f','o','W','i','n','d','o','w',0};
|
|
|
|
static const WCHAR COLOR_ALTERNATEBTNFACE_VALNAME[] = {COLORS_KEY,'B','u','t','t','o','n','A','l','t','e','r','n','a','t','e','F','a','c','e',0};
|
|
|
|
static const WCHAR COLOR_HOTLIGHT_VALNAME[] = {COLORS_KEY,'H','o','t','T','r','a','c','k','i','n','g','C','o','l','o','r',0};
|
|
|
|
static const WCHAR COLOR_GRADIENTACTIVECAPTION_VALNAME[] = {COLORS_KEY,'G','r','a','d','i','e','n','t','A','c','t','i','v','e','T','i','t','l','e',0};
|
|
|
|
static const WCHAR COLOR_GRADIENTINACTIVECAPTION_VALNAME[] = {COLORS_KEY,'G','r','a','d','i','e','n','t','I','n','a','c','t','i','v','e','T','i','t','l','e',0};
|
|
|
|
static const WCHAR COLOR_MENUHILIGHT_VALNAME[] = {COLORS_KEY,'M','e','n','u','H','i','l','i','g','h','t',0};
|
|
|
|
static const WCHAR COLOR_MENUBAR_VALNAME[] = {COLORS_KEY,'M','e','n','u','B','a','r',0};
|
|
|
|
|
2012-11-16 12:22:31 +01:00
|
|
|
/* FIXME - real value */
|
|
|
|
static const WCHAR SCREENSAVERRUNNING_VALNAME[]= {DESKTOP_KEY,'W','I','N','E','_','S','c','r','e','e','n','S','a','v','e','r','R','u','n','n','i','n','g',0};
|
2005-01-03 17:59:41 +01:00
|
|
|
|
2005-06-14 19:26:52 +02:00
|
|
|
static const WCHAR WINE_CURRENT_USER_REGKEY[] = {'S','o','f','t','w','a','r','e','\\',
|
2005-09-18 13:11:49 +02:00
|
|
|
'W','i','n','e',0};
|
2004-03-04 02:41:11 +01:00
|
|
|
|
2005-09-18 13:11:49 +02:00
|
|
|
/* volatile registry branch under WINE_CURRENT_USER_REGKEY for temporary values storage */
|
|
|
|
static const WCHAR WINE_CURRENT_USER_REGKEY_TEMP_PARAMS[] = {'T','e','m','p','o','r','a','r','y',' ',
|
|
|
|
'S','y','s','t','e','m',' ',
|
|
|
|
'P','a','r','a','m','e','t','e','r','s',0};
|
2004-03-04 02:41:11 +01:00
|
|
|
|
2012-11-19 15:18:44 +01:00
|
|
|
static const WCHAR Yes[] = {'Y','e','s',0};
|
|
|
|
static const WCHAR No[] = {'N','o',0};
|
|
|
|
static const WCHAR CSu[] = {'%','u',0};
|
|
|
|
static const WCHAR CSd[] = {'%','d',0};
|
|
|
|
static const WCHAR CSrgb[] = {'%','u',' ','%','u',' ','%','u',0};
|
2001-11-07 21:24:29 +01:00
|
|
|
|
|
|
|
/* Indicators whether system parameter value is loaded */
|
2005-07-15 18:35:27 +02:00
|
|
|
static char spi_loaded[SPI_INDEX_COUNT];
|
2001-11-07 21:24:29 +01:00
|
|
|
|
|
|
|
static BOOL notify_change = TRUE;
|
|
|
|
|
|
|
|
/* System parameters storage */
|
2001-12-21 21:31:24 +01:00
|
|
|
static RECT work_area;
|
2005-07-18 11:20:07 +02:00
|
|
|
|
2012-11-16 16:52:40 +01:00
|
|
|
static HKEY volatile_base_key;
|
|
|
|
|
2012-11-13 15:10:05 +01:00
|
|
|
union sysparam_all_entry;
|
|
|
|
|
|
|
|
struct sysparam_entry
|
|
|
|
{
|
|
|
|
BOOL (*get)( union sysparam_all_entry *entry, UINT int_param, void *ptr_param );
|
|
|
|
BOOL (*set)( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags );
|
2012-11-16 16:52:40 +01:00
|
|
|
BOOL (*init)( union sysparam_all_entry *entry );
|
2012-11-13 15:10:05 +01:00
|
|
|
const WCHAR *regval;
|
|
|
|
const WCHAR *mirror;
|
|
|
|
BOOL loaded;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sysparam_uint_entry
|
|
|
|
{
|
|
|
|
struct sysparam_entry hdr;
|
|
|
|
UINT val;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sysparam_bool_entry
|
|
|
|
{
|
|
|
|
struct sysparam_entry hdr;
|
|
|
|
BOOL val;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sysparam_dword_entry
|
|
|
|
{
|
|
|
|
struct sysparam_entry hdr;
|
|
|
|
DWORD val;
|
|
|
|
};
|
|
|
|
|
2012-11-19 15:18:44 +01:00
|
|
|
struct sysparam_rgb_entry
|
|
|
|
{
|
|
|
|
struct sysparam_entry hdr;
|
|
|
|
COLORREF val;
|
|
|
|
HBRUSH brush;
|
|
|
|
HPEN pen;
|
|
|
|
};
|
|
|
|
|
2012-11-14 12:19:19 +01:00
|
|
|
struct sysparam_binary_entry
|
|
|
|
{
|
|
|
|
struct sysparam_entry hdr;
|
|
|
|
void *ptr;
|
|
|
|
size_t size;
|
|
|
|
};
|
|
|
|
|
2012-11-15 15:54:52 +01:00
|
|
|
struct sysparam_path_entry
|
|
|
|
{
|
|
|
|
struct sysparam_entry hdr;
|
|
|
|
WCHAR path[MAX_PATH];
|
|
|
|
};
|
|
|
|
|
2012-11-13 15:10:05 +01:00
|
|
|
struct sysparam_font_entry
|
|
|
|
{
|
|
|
|
struct sysparam_entry hdr;
|
2012-11-15 13:28:22 +01:00
|
|
|
UINT weight;
|
2012-11-13 15:10:05 +01:00
|
|
|
LOGFONTW val;
|
|
|
|
};
|
|
|
|
|
2012-11-14 12:19:19 +01:00
|
|
|
struct sysparam_pref_entry
|
|
|
|
{
|
|
|
|
struct sysparam_entry hdr;
|
|
|
|
struct sysparam_binary_entry *parent;
|
|
|
|
UINT offset;
|
|
|
|
UINT mask;
|
|
|
|
};
|
|
|
|
|
2012-11-13 15:10:05 +01:00
|
|
|
union sysparam_all_entry
|
|
|
|
{
|
2012-11-14 12:19:19 +01:00
|
|
|
struct sysparam_entry hdr;
|
|
|
|
struct sysparam_uint_entry uint;
|
|
|
|
struct sysparam_bool_entry bool;
|
|
|
|
struct sysparam_dword_entry dword;
|
2012-11-19 15:18:44 +01:00
|
|
|
struct sysparam_rgb_entry rgb;
|
2012-11-14 12:19:19 +01:00
|
|
|
struct sysparam_binary_entry bin;
|
2012-11-15 15:54:52 +01:00
|
|
|
struct sysparam_path_entry path;
|
2012-11-14 12:19:19 +01:00
|
|
|
struct sysparam_font_entry font;
|
|
|
|
struct sysparam_pref_entry pref;
|
2012-11-13 15:10:05 +01:00
|
|
|
};
|
2000-06-24 14:54:00 +02:00
|
|
|
|
2005-06-21 22:02:54 +02:00
|
|
|
static void SYSPARAMS_LogFont16To32W( const LOGFONT16 *font16, LPLOGFONTW font32 )
|
|
|
|
{
|
|
|
|
font32->lfHeight = font16->lfHeight;
|
|
|
|
font32->lfWidth = font16->lfWidth;
|
|
|
|
font32->lfEscapement = font16->lfEscapement;
|
|
|
|
font32->lfOrientation = font16->lfOrientation;
|
|
|
|
font32->lfWeight = font16->lfWeight;
|
|
|
|
font32->lfItalic = font16->lfItalic;
|
|
|
|
font32->lfUnderline = font16->lfUnderline;
|
|
|
|
font32->lfStrikeOut = font16->lfStrikeOut;
|
|
|
|
font32->lfCharSet = font16->lfCharSet;
|
|
|
|
font32->lfOutPrecision = font16->lfOutPrecision;
|
|
|
|
font32->lfClipPrecision = font16->lfClipPrecision;
|
|
|
|
font32->lfQuality = font16->lfQuality;
|
|
|
|
font32->lfPitchAndFamily = font16->lfPitchAndFamily;
|
|
|
|
MultiByteToWideChar( CP_ACP, 0, font16->lfFaceName, -1, font32->lfFaceName, LF_FACESIZE );
|
|
|
|
font32->lfFaceName[LF_FACESIZE-1] = 0;
|
|
|
|
}
|
|
|
|
|
2004-03-04 02:41:11 +01:00
|
|
|
static void SYSPARAMS_LogFont32WTo32A( const LOGFONTW* font32W, LPLOGFONTA font32A )
|
2000-11-05 04:18:47 +01:00
|
|
|
{
|
2004-03-04 02:41:11 +01:00
|
|
|
font32A->lfHeight = font32W->lfHeight;
|
|
|
|
font32A->lfWidth = font32W->lfWidth;
|
|
|
|
font32A->lfEscapement = font32W->lfEscapement;
|
|
|
|
font32A->lfOrientation = font32W->lfOrientation;
|
|
|
|
font32A->lfWeight = font32W->lfWeight;
|
|
|
|
font32A->lfItalic = font32W->lfItalic;
|
|
|
|
font32A->lfUnderline = font32W->lfUnderline;
|
|
|
|
font32A->lfStrikeOut = font32W->lfStrikeOut;
|
|
|
|
font32A->lfCharSet = font32W->lfCharSet;
|
|
|
|
font32A->lfOutPrecision = font32W->lfOutPrecision;
|
|
|
|
font32A->lfClipPrecision = font32W->lfClipPrecision;
|
|
|
|
font32A->lfQuality = font32W->lfQuality;
|
|
|
|
font32A->lfPitchAndFamily = font32W->lfPitchAndFamily;
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, font32W->lfFaceName, -1, font32A->lfFaceName, LF_FACESIZE, NULL, NULL );
|
|
|
|
font32A->lfFaceName[LF_FACESIZE-1] = 0;
|
2000-11-05 04:18:47 +01:00
|
|
|
}
|
|
|
|
|
2005-11-07 17:39:21 +01:00
|
|
|
static void SYSPARAMS_LogFont32ATo32W( const LOGFONTA* font32A, LPLOGFONTW font32W )
|
|
|
|
{
|
|
|
|
font32W->lfHeight = font32A->lfHeight;
|
|
|
|
font32W->lfWidth = font32A->lfWidth;
|
|
|
|
font32W->lfEscapement = font32A->lfEscapement;
|
|
|
|
font32W->lfOrientation = font32A->lfOrientation;
|
|
|
|
font32W->lfWeight = font32A->lfWeight;
|
|
|
|
font32W->lfItalic = font32A->lfItalic;
|
|
|
|
font32W->lfUnderline = font32A->lfUnderline;
|
|
|
|
font32W->lfStrikeOut = font32A->lfStrikeOut;
|
|
|
|
font32W->lfCharSet = font32A->lfCharSet;
|
|
|
|
font32W->lfOutPrecision = font32A->lfOutPrecision;
|
|
|
|
font32W->lfClipPrecision = font32A->lfClipPrecision;
|
|
|
|
font32W->lfQuality = font32A->lfQuality;
|
|
|
|
font32W->lfPitchAndFamily = font32A->lfPitchAndFamily;
|
|
|
|
MultiByteToWideChar( CP_ACP, 0, font32A->lfFaceName, -1, font32W->lfFaceName, LF_FACESIZE );
|
|
|
|
font32W->lfFaceName[LF_FACESIZE-1] = 0;
|
|
|
|
}
|
|
|
|
|
2004-03-04 02:41:11 +01:00
|
|
|
static void SYSPARAMS_NonClientMetrics32WTo32A( const NONCLIENTMETRICSW* lpnm32W, LPNONCLIENTMETRICSA lpnm32A )
|
2000-11-05 04:18:47 +01:00
|
|
|
{
|
2004-03-04 02:41:11 +01:00
|
|
|
lpnm32A->iBorderWidth = lpnm32W->iBorderWidth;
|
|
|
|
lpnm32A->iScrollWidth = lpnm32W->iScrollWidth;
|
|
|
|
lpnm32A->iScrollHeight = lpnm32W->iScrollHeight;
|
|
|
|
lpnm32A->iCaptionWidth = lpnm32W->iCaptionWidth;
|
|
|
|
lpnm32A->iCaptionHeight = lpnm32W->iCaptionHeight;
|
|
|
|
SYSPARAMS_LogFont32WTo32A( &lpnm32W->lfCaptionFont, &lpnm32A->lfCaptionFont );
|
|
|
|
lpnm32A->iSmCaptionWidth = lpnm32W->iSmCaptionWidth;
|
|
|
|
lpnm32A->iSmCaptionHeight = lpnm32W->iSmCaptionHeight;
|
|
|
|
SYSPARAMS_LogFont32WTo32A( &lpnm32W->lfSmCaptionFont, &lpnm32A->lfSmCaptionFont );
|
|
|
|
lpnm32A->iMenuWidth = lpnm32W->iMenuWidth;
|
|
|
|
lpnm32A->iMenuHeight = lpnm32W->iMenuHeight;
|
|
|
|
SYSPARAMS_LogFont32WTo32A( &lpnm32W->lfMenuFont, &lpnm32A->lfMenuFont );
|
|
|
|
SYSPARAMS_LogFont32WTo32A( &lpnm32W->lfStatusFont, &lpnm32A->lfStatusFont );
|
|
|
|
SYSPARAMS_LogFont32WTo32A( &lpnm32W->lfMessageFont, &lpnm32A->lfMessageFont );
|
2011-10-10 05:05:14 +02:00
|
|
|
if (lpnm32A->cbSize > FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth))
|
|
|
|
{
|
|
|
|
if (lpnm32W->cbSize > FIELD_OFFSET(NONCLIENTMETRICSW, iPaddedBorderWidth))
|
|
|
|
lpnm32A->iPaddedBorderWidth = lpnm32W->iPaddedBorderWidth;
|
|
|
|
else
|
|
|
|
lpnm32A->iPaddedBorderWidth = 0;
|
|
|
|
}
|
2000-11-05 04:18:47 +01:00
|
|
|
}
|
|
|
|
|
2005-11-07 17:39:21 +01:00
|
|
|
static void SYSPARAMS_NonClientMetrics32ATo32W( const NONCLIENTMETRICSA* lpnm32A, LPNONCLIENTMETRICSW lpnm32W )
|
|
|
|
{
|
|
|
|
lpnm32W->iBorderWidth = lpnm32A->iBorderWidth;
|
|
|
|
lpnm32W->iScrollWidth = lpnm32A->iScrollWidth;
|
|
|
|
lpnm32W->iScrollHeight = lpnm32A->iScrollHeight;
|
|
|
|
lpnm32W->iCaptionWidth = lpnm32A->iCaptionWidth;
|
|
|
|
lpnm32W->iCaptionHeight = lpnm32A->iCaptionHeight;
|
|
|
|
SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfCaptionFont, &lpnm32W->lfCaptionFont );
|
|
|
|
lpnm32W->iSmCaptionWidth = lpnm32A->iSmCaptionWidth;
|
|
|
|
lpnm32W->iSmCaptionHeight = lpnm32A->iSmCaptionHeight;
|
|
|
|
SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfSmCaptionFont, &lpnm32W->lfSmCaptionFont );
|
|
|
|
lpnm32W->iMenuWidth = lpnm32A->iMenuWidth;
|
|
|
|
lpnm32W->iMenuHeight = lpnm32A->iMenuHeight;
|
|
|
|
SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfMenuFont, &lpnm32W->lfMenuFont );
|
|
|
|
SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfStatusFont, &lpnm32W->lfStatusFont );
|
|
|
|
SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfMessageFont, &lpnm32W->lfMessageFont );
|
2011-10-10 05:05:14 +02:00
|
|
|
if (lpnm32W->cbSize > FIELD_OFFSET(NONCLIENTMETRICSW, iPaddedBorderWidth))
|
|
|
|
{
|
|
|
|
if (lpnm32A->cbSize > FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth))
|
|
|
|
lpnm32W->iPaddedBorderWidth = lpnm32A->iPaddedBorderWidth;
|
|
|
|
else
|
|
|
|
lpnm32W->iPaddedBorderWidth = 0;
|
|
|
|
}
|
2005-11-07 17:39:21 +01:00
|
|
|
}
|
|
|
|
|
2006-10-23 14:29:57 +02:00
|
|
|
|
|
|
|
/* Helper functions to retrieve monitors info */
|
|
|
|
|
|
|
|
struct monitor_info
|
|
|
|
{
|
|
|
|
int count;
|
|
|
|
RECT virtual_rect;
|
|
|
|
};
|
|
|
|
|
|
|
|
static BOOL CALLBACK monitor_info_proc( HMONITOR monitor, HDC hdc, LPRECT rect, LPARAM lp )
|
|
|
|
{
|
|
|
|
struct monitor_info *info = (struct monitor_info *)lp;
|
|
|
|
info->count++;
|
|
|
|
UnionRect( &info->virtual_rect, &info->virtual_rect, rect );
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void get_monitors_info( struct monitor_info *info )
|
|
|
|
{
|
|
|
|
info->count = 0;
|
|
|
|
SetRectEmpty( &info->virtual_rect );
|
|
|
|
EnumDisplayMonitors( 0, NULL, monitor_info_proc, (LPARAM)info );
|
|
|
|
}
|
|
|
|
|
2012-09-05 19:28:50 +02:00
|
|
|
RECT get_virtual_screen_rect(void)
|
|
|
|
{
|
|
|
|
struct monitor_info info;
|
|
|
|
get_monitors_info( &info );
|
|
|
|
return info.virtual_rect;
|
|
|
|
}
|
2006-10-23 14:29:57 +02:00
|
|
|
|
2005-11-22 15:56:11 +01:00
|
|
|
/* get text metrics and/or "average" char width of the specified logfont
|
|
|
|
* for the specified dc */
|
|
|
|
static void get_text_metr_size( HDC hdc, LOGFONTW *plf, TEXTMETRICW * ptm, UINT *psz)
|
|
|
|
{
|
|
|
|
HFONT hfont, hfontsav;
|
|
|
|
TEXTMETRICW tm;
|
|
|
|
if( !ptm) ptm = &tm;
|
|
|
|
hfont = CreateFontIndirectW( plf);
|
|
|
|
if( !hfont || ( hfontsav = SelectObject( hdc, hfont)) == NULL ) {
|
|
|
|
ptm->tmHeight = -1;
|
|
|
|
if( psz) *psz = 10;
|
|
|
|
if( hfont) DeleteObject( hfont);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
GetTextMetricsW( hdc, ptm);
|
|
|
|
if( psz)
|
|
|
|
if( !(*psz = GdiGetCharDimensions( hdc, ptm, NULL)))
|
|
|
|
*psz = 10;
|
|
|
|
SelectObject( hdc, hfontsav);
|
|
|
|
DeleteObject( hfont);
|
|
|
|
}
|
2001-11-07 21:24:29 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* SYSPARAMS_NotifyChange
|
|
|
|
*
|
|
|
|
* Sends notification about system parameter update.
|
|
|
|
*/
|
2005-06-22 20:05:02 +02:00
|
|
|
static void SYSPARAMS_NotifyChange( UINT uiAction, UINT fWinIni )
|
2001-11-07 21:24:29 +01:00
|
|
|
{
|
2003-10-31 05:18:55 +01:00
|
|
|
static const WCHAR emptyW[1];
|
|
|
|
|
2001-11-07 21:24:29 +01:00
|
|
|
if (notify_change)
|
|
|
|
{
|
|
|
|
if (fWinIni & SPIF_UPDATEINIFILE)
|
|
|
|
{
|
|
|
|
if (fWinIni & (SPIF_SENDWININICHANGE | SPIF_SENDCHANGE))
|
2003-10-31 05:18:55 +01:00
|
|
|
SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE,
|
|
|
|
uiAction, (LPARAM) emptyW,
|
|
|
|
SMTO_ABORTIFHUNG, 2000, NULL );
|
2001-11-07 21:24:29 +01:00
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
else
|
2001-11-07 21:24:29 +01:00
|
|
|
{
|
|
|
|
/* FIXME notify other wine processes with internal message */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-16 12:39:43 +01:00
|
|
|
/* retrieve the cached base keys for a given entry */
|
|
|
|
static BOOL get_base_keys( enum parameter_key index, HKEY *base_key, HKEY *volatile_key )
|
2001-11-07 21:24:29 +01:00
|
|
|
{
|
2012-11-16 12:39:43 +01:00
|
|
|
static HKEY base_keys[NB_PARAM_KEYS];
|
|
|
|
static HKEY volatile_keys[NB_PARAM_KEYS];
|
|
|
|
HKEY key;
|
2001-11-07 21:24:29 +01:00
|
|
|
|
2012-11-16 12:39:43 +01:00
|
|
|
if (!base_keys[index] && base_key)
|
2001-11-07 21:24:29 +01:00
|
|
|
{
|
2012-11-16 12:39:43 +01:00
|
|
|
if (RegCreateKeyW( HKEY_CURRENT_USER, parameter_key_names[index], &key )) return FALSE;
|
|
|
|
if (InterlockedCompareExchangePointer( (void **)&base_keys[index], key, 0 ))
|
|
|
|
RegCloseKey( key );
|
2001-11-07 21:24:29 +01:00
|
|
|
}
|
2012-11-16 12:39:43 +01:00
|
|
|
if (!volatile_keys[index] && volatile_key)
|
2001-11-07 21:24:29 +01:00
|
|
|
{
|
2012-11-16 16:52:40 +01:00
|
|
|
if (RegCreateKeyExW( volatile_base_key, parameter_key_names[index],
|
2012-11-16 12:39:43 +01:00
|
|
|
0, 0, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &key, 0 )) return FALSE;
|
|
|
|
if (InterlockedCompareExchangePointer( (void **)&volatile_keys[index], key, 0 ))
|
|
|
|
RegCloseKey( key );
|
2001-11-07 21:24:29 +01:00
|
|
|
}
|
2012-11-16 12:39:43 +01:00
|
|
|
if (base_key) *base_key = base_keys[index];
|
|
|
|
if (volatile_key) *volatile_key = volatile_keys[index];
|
|
|
|
return TRUE;
|
2001-11-07 21:24:29 +01:00
|
|
|
}
|
|
|
|
|
2012-11-14 13:22:25 +01:00
|
|
|
/* load a value to a registry entry */
|
2012-11-15 16:18:16 +01:00
|
|
|
static DWORD load_entry( struct sysparam_entry *entry, void *data, DWORD size )
|
2012-11-14 13:22:25 +01:00
|
|
|
{
|
2015-11-06 05:00:42 +01:00
|
|
|
DWORD type, count;
|
2012-11-16 12:39:43 +01:00
|
|
|
HKEY base_key, volatile_key;
|
2012-11-15 16:18:16 +01:00
|
|
|
|
2012-11-16 12:39:43 +01:00
|
|
|
if (!get_base_keys( entry->regval[0], &base_key, &volatile_key )) return FALSE;
|
|
|
|
|
|
|
|
count = size;
|
|
|
|
if (RegQueryValueExW( volatile_key, entry->regval + 1, NULL, &type, data, &count ))
|
2012-11-15 16:18:16 +01:00
|
|
|
{
|
|
|
|
count = size;
|
2012-11-16 12:39:43 +01:00
|
|
|
if (RegQueryValueExW( base_key, entry->regval + 1, NULL, &type, data, &count )) count = 0;
|
2012-11-15 16:18:16 +01:00
|
|
|
}
|
|
|
|
/* make sure strings are null-terminated */
|
|
|
|
if (size && count == size && type == REG_SZ) ((WCHAR *)data)[count - 1] = 0;
|
2012-11-14 13:22:25 +01:00
|
|
|
entry->loaded = TRUE;
|
2012-11-15 16:18:16 +01:00
|
|
|
return count;
|
2012-11-14 13:22:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* save a value to a registry entry */
|
|
|
|
static BOOL save_entry( const struct sysparam_entry *entry, const void *data, DWORD size,
|
|
|
|
DWORD type, UINT flags )
|
|
|
|
{
|
2012-11-16 12:39:43 +01:00
|
|
|
HKEY base_key, volatile_key;
|
|
|
|
|
|
|
|
if (flags & SPIF_UPDATEINIFILE)
|
|
|
|
{
|
|
|
|
if (!get_base_keys( entry->regval[0], &base_key, &volatile_key )) return FALSE;
|
|
|
|
if (RegSetValueExW( base_key, entry->regval + 1, 0, type, data, size )) return FALSE;
|
|
|
|
RegDeleteValueW( volatile_key, entry->regval + 1 );
|
|
|
|
|
|
|
|
if (entry->mirror && get_base_keys( entry->mirror[0], &base_key, NULL ))
|
|
|
|
RegSetValueExW( base_key, entry->mirror + 1, 0, type, data, size );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!get_base_keys( entry->regval[0], NULL, &volatile_key )) return FALSE;
|
|
|
|
if (RegSetValueExW( volatile_key, entry->regval + 1, 0, type, data, size )) return FALSE;
|
|
|
|
}
|
2012-11-14 13:22:25 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* save a string value to a registry entry */
|
|
|
|
static BOOL save_entry_string( const struct sysparam_entry *entry, const WCHAR *str, UINT flags )
|
|
|
|
{
|
|
|
|
return save_entry( entry, str, (strlenW(str) + 1) * sizeof(WCHAR), REG_SZ, flags );
|
|
|
|
}
|
2001-12-06 23:28:43 +01:00
|
|
|
|
2012-11-16 16:52:40 +01:00
|
|
|
/* initialize an entry in the registry if missing */
|
|
|
|
static BOOL init_entry( struct sysparam_entry *entry, const void *data, DWORD size, DWORD type )
|
|
|
|
{
|
|
|
|
HKEY base_key;
|
|
|
|
|
|
|
|
if (!get_base_keys( entry->regval[0], &base_key, NULL )) return FALSE;
|
|
|
|
if (!RegQueryValueExW( base_key, entry->regval + 1, NULL, NULL, NULL, NULL )) return TRUE;
|
|
|
|
if (RegSetValueExW( base_key, entry->regval + 1, 0, type, data, size )) return FALSE;
|
|
|
|
if (entry->mirror && get_base_keys( entry->mirror[0], &base_key, NULL ))
|
|
|
|
RegSetValueExW( base_key, entry->mirror + 1, 0, type, data, size );
|
|
|
|
entry->loaded = TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize a string value in the registry if missing */
|
|
|
|
static BOOL init_entry_string( struct sysparam_entry *entry, const WCHAR *str )
|
|
|
|
{
|
|
|
|
return init_entry( entry, str, (strlenW(str) + 1) * sizeof(WCHAR), REG_SZ );
|
|
|
|
}
|
|
|
|
|
2005-07-18 11:20:07 +02:00
|
|
|
static inline HDC get_display_dc(void)
|
|
|
|
{
|
|
|
|
static const WCHAR DISPLAY[] = {'D','I','S','P','L','A','Y',0};
|
|
|
|
static HDC display_dc;
|
2009-05-05 15:36:44 +02:00
|
|
|
if (!display_dc)
|
|
|
|
{
|
|
|
|
display_dc = CreateICW( DISPLAY, NULL, NULL, NULL );
|
|
|
|
__wine_make_gdi_object_system( display_dc, TRUE );
|
|
|
|
}
|
2005-07-18 11:20:07 +02:00
|
|
|
return display_dc;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int get_display_dpi(void)
|
|
|
|
{
|
|
|
|
static int display_dpi;
|
|
|
|
if (!display_dpi) display_dpi = GetDeviceCaps( get_display_dc(), LOGPIXELSY );
|
|
|
|
return display_dpi;
|
|
|
|
}
|
|
|
|
|
2015-07-17 11:23:24 +02:00
|
|
|
static INT CALLBACK real_fontname_proc(const LOGFONTW *lf, const TEXTMETRICW *ntm, DWORD type, LPARAM lparam)
|
|
|
|
{
|
|
|
|
const ENUMLOGFONTW *elf = (const ENUMLOGFONTW *)lf;
|
|
|
|
LOGFONTW *lfW = (LOGFONTW *)lparam;
|
|
|
|
|
|
|
|
lstrcpynW(lfW->lfFaceName, elf->elfFullName, LF_FACESIZE);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void get_real_fontname(LOGFONTW *lf)
|
|
|
|
{
|
|
|
|
EnumFontFamiliesExW(get_display_dc(), lf, real_fontname_proc, (LPARAM)lf, 0);
|
|
|
|
}
|
|
|
|
|
2005-12-16 12:38:06 +01:00
|
|
|
/* adjust some of the raw values found in the registry */
|
|
|
|
static void normalize_nonclientmetrics( NONCLIENTMETRICSW *pncm)
|
|
|
|
{
|
|
|
|
TEXTMETRICW tm;
|
|
|
|
if( pncm->iBorderWidth < 1) pncm->iBorderWidth = 1;
|
|
|
|
if( pncm->iCaptionWidth < 8) pncm->iCaptionWidth = 8;
|
|
|
|
if( pncm->iScrollWidth < 8) pncm->iScrollWidth = 8;
|
|
|
|
if( pncm->iScrollHeight < 8) pncm->iScrollHeight = 8;
|
|
|
|
|
|
|
|
/* adjust some heights to the corresponding font */
|
2012-11-15 13:28:54 +01:00
|
|
|
get_text_metr_size( get_display_dc(), &pncm->lfMenuFont, &tm, NULL);
|
|
|
|
pncm->iMenuHeight = max( pncm->iMenuHeight, 2 + tm.tmHeight + tm.tmExternalLeading );
|
2015-07-17 11:23:24 +02:00
|
|
|
get_real_fontname( &pncm->lfMenuFont );
|
2005-12-16 12:38:06 +01:00
|
|
|
get_text_metr_size( get_display_dc(), &pncm->lfCaptionFont, &tm, NULL);
|
|
|
|
pncm->iCaptionHeight = max( pncm->iCaptionHeight, 2 + tm.tmHeight);
|
2015-07-17 11:23:24 +02:00
|
|
|
get_real_fontname( &pncm->lfCaptionFont );
|
2005-12-16 12:38:06 +01:00
|
|
|
get_text_metr_size( get_display_dc(), &pncm->lfSmCaptionFont, &tm, NULL);
|
|
|
|
pncm->iSmCaptionHeight = max( pncm->iSmCaptionHeight, 2 + tm.tmHeight);
|
2015-07-17 11:23:24 +02:00
|
|
|
get_real_fontname( &pncm->lfSmCaptionFont );
|
|
|
|
|
|
|
|
get_real_fontname( &pncm->lfStatusFont );
|
|
|
|
get_real_fontname( &pncm->lfMessageFont );
|
2005-12-16 12:38:06 +01:00
|
|
|
}
|
|
|
|
|
2008-09-11 06:20:15 +02:00
|
|
|
static BOOL CALLBACK enum_monitors( HMONITOR monitor, HDC hdc, LPRECT rect, LPARAM lp )
|
|
|
|
{
|
|
|
|
MONITORINFO mi;
|
|
|
|
|
|
|
|
mi.cbSize = sizeof(mi);
|
|
|
|
if (GetMonitorInfoW( monitor, &mi ) && (mi.dwFlags & MONITORINFOF_PRIMARY))
|
|
|
|
{
|
|
|
|
LPRECT work = (LPRECT)lp;
|
|
|
|
*work = mi.rcWork;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
2005-07-18 11:20:07 +02:00
|
|
|
|
2012-11-13 15:10:05 +01:00
|
|
|
/* load a uint parameter from the registry */
|
|
|
|
static BOOL get_uint_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param )
|
|
|
|
{
|
|
|
|
if (!ptr_param) return FALSE;
|
|
|
|
|
|
|
|
if (!entry->hdr.loaded)
|
|
|
|
{
|
|
|
|
WCHAR buf[32];
|
|
|
|
|
2012-11-14 13:22:25 +01:00
|
|
|
if (load_entry( &entry->hdr, buf, sizeof(buf) )) entry->uint.val = atoiW( buf );
|
2012-11-13 15:10:05 +01:00
|
|
|
}
|
|
|
|
*(UINT *)ptr_param = entry->uint.val;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* set a uint parameter in the registry */
|
|
|
|
static BOOL set_uint_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags )
|
|
|
|
{
|
|
|
|
WCHAR buf[32];
|
|
|
|
|
|
|
|
wsprintfW( buf, CSu, int_param );
|
2012-11-14 13:22:25 +01:00
|
|
|
if (!save_entry_string( &entry->hdr, buf, flags )) return FALSE;
|
2012-11-13 15:10:05 +01:00
|
|
|
entry->uint.val = int_param;
|
|
|
|
entry->hdr.loaded = TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2012-11-16 16:52:40 +01:00
|
|
|
/* initialize a uint parameter */
|
|
|
|
static BOOL init_uint_entry( union sysparam_all_entry *entry )
|
|
|
|
{
|
|
|
|
WCHAR buf[32];
|
|
|
|
|
|
|
|
wsprintfW( buf, CSu, entry->uint.val );
|
|
|
|
return init_entry_string( &entry->hdr, buf );
|
|
|
|
}
|
|
|
|
|
2012-11-13 15:10:05 +01:00
|
|
|
/* set an int parameter in the registry */
|
|
|
|
static BOOL set_int_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags )
|
|
|
|
{
|
|
|
|
WCHAR buf[32];
|
|
|
|
|
|
|
|
wsprintfW( buf, CSd, int_param );
|
2012-11-14 13:22:25 +01:00
|
|
|
if (!save_entry_string( &entry->hdr, buf, flags )) return FALSE;
|
2012-11-13 15:10:05 +01:00
|
|
|
entry->uint.val = int_param;
|
|
|
|
entry->hdr.loaded = TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2012-11-16 16:52:40 +01:00
|
|
|
/* initialize an int parameter */
|
|
|
|
static BOOL init_int_entry( union sysparam_all_entry *entry )
|
|
|
|
{
|
|
|
|
WCHAR buf[32];
|
|
|
|
|
|
|
|
wsprintfW( buf, CSd, entry->uint.val );
|
|
|
|
return init_entry_string( &entry->hdr, buf );
|
|
|
|
}
|
|
|
|
|
2012-11-13 15:10:05 +01:00
|
|
|
/* load a twips parameter from the registry */
|
|
|
|
static BOOL get_twips_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param )
|
|
|
|
{
|
|
|
|
if (!ptr_param) return FALSE;
|
|
|
|
|
|
|
|
if (!entry->hdr.loaded)
|
|
|
|
{
|
|
|
|
WCHAR buf[32];
|
|
|
|
|
2012-11-14 13:22:25 +01:00
|
|
|
if (load_entry( &entry->hdr, buf, sizeof(buf) ))
|
2012-11-15 13:28:54 +01:00
|
|
|
{
|
|
|
|
int val = atoiW( buf );
|
2015-03-27 14:19:47 +01:00
|
|
|
/* Dimensions are quoted as being "twips" values if negative and pixels if positive.
|
2012-11-15 13:28:54 +01:00
|
|
|
* One inch is 1440 twips.
|
|
|
|
* See for example
|
|
|
|
* Technical Reference to the Windows 2000 Registry ->
|
|
|
|
* HKEY_CURRENT_USER -> Control Panel -> Desktop -> WindowMetrics
|
|
|
|
*/
|
|
|
|
if (val < 0) val = (-val * get_display_dpi() + 720) / 1440;
|
|
|
|
entry->uint.val = val;
|
|
|
|
}
|
2012-11-13 15:10:05 +01:00
|
|
|
}
|
|
|
|
*(UINT *)ptr_param = entry->uint.val;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* load a bool parameter from the registry */
|
|
|
|
static BOOL get_bool_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param )
|
|
|
|
{
|
|
|
|
if (!ptr_param) return FALSE;
|
|
|
|
|
|
|
|
if (!entry->hdr.loaded)
|
|
|
|
{
|
|
|
|
WCHAR buf[32];
|
|
|
|
|
2012-11-14 13:22:25 +01:00
|
|
|
if (load_entry( &entry->hdr, buf, sizeof(buf) )) entry->bool.val = atoiW( buf ) != 0;
|
2012-11-13 15:10:05 +01:00
|
|
|
}
|
|
|
|
*(UINT *)ptr_param = entry->bool.val;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* set a bool parameter in the registry */
|
|
|
|
static BOOL set_bool_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags )
|
|
|
|
{
|
|
|
|
WCHAR buf[32];
|
|
|
|
|
|
|
|
wsprintfW( buf, CSu, int_param != 0 );
|
2012-11-14 13:22:25 +01:00
|
|
|
if (!save_entry_string( &entry->hdr, buf, flags )) return FALSE;
|
2012-11-13 15:10:05 +01:00
|
|
|
entry->bool.val = int_param != 0;
|
|
|
|
entry->hdr.loaded = TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2012-11-16 16:52:40 +01:00
|
|
|
/* initialize a bool parameter */
|
|
|
|
static BOOL init_bool_entry( union sysparam_all_entry *entry )
|
|
|
|
{
|
|
|
|
WCHAR buf[32];
|
|
|
|
|
|
|
|
wsprintfW( buf, CSu, entry->bool.val != 0 );
|
|
|
|
return init_entry_string( &entry->hdr, buf );
|
|
|
|
}
|
|
|
|
|
2012-11-13 15:10:05 +01:00
|
|
|
/* load a bool parameter using Yes/No strings from the registry */
|
|
|
|
static BOOL get_yesno_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param )
|
|
|
|
{
|
|
|
|
if (!ptr_param) return FALSE;
|
|
|
|
|
|
|
|
if (!entry->hdr.loaded)
|
|
|
|
{
|
|
|
|
WCHAR buf[32];
|
|
|
|
|
2012-11-14 13:22:25 +01:00
|
|
|
if (load_entry( &entry->hdr, buf, sizeof(buf) )) entry->bool.val = !lstrcmpiW( Yes, buf );
|
2012-11-13 15:10:05 +01:00
|
|
|
}
|
|
|
|
*(UINT *)ptr_param = entry->bool.val;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* set a bool parameter using Yes/No strings from the registry */
|
|
|
|
static BOOL set_yesno_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags )
|
|
|
|
{
|
|
|
|
const WCHAR *str = int_param ? Yes : No;
|
|
|
|
|
2012-11-14 13:22:25 +01:00
|
|
|
if (!save_entry_string( &entry->hdr, str, flags )) return FALSE;
|
2012-11-13 15:10:05 +01:00
|
|
|
entry->bool.val = int_param != 0;
|
|
|
|
entry->hdr.loaded = TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2012-11-16 16:52:40 +01:00
|
|
|
/* initialize a bool parameter using Yes/No strings */
|
|
|
|
static BOOL init_yesno_entry( union sysparam_all_entry *entry )
|
|
|
|
{
|
|
|
|
return init_entry_string( &entry->hdr, entry->bool.val ? Yes : No );
|
|
|
|
}
|
|
|
|
|
2012-11-13 15:10:05 +01:00
|
|
|
/* load a dword (binary) parameter from the registry */
|
|
|
|
static BOOL get_dword_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param )
|
|
|
|
{
|
|
|
|
if (!ptr_param) return FALSE;
|
|
|
|
|
|
|
|
if (!entry->hdr.loaded)
|
|
|
|
{
|
|
|
|
DWORD val;
|
2012-11-15 16:18:16 +01:00
|
|
|
if (load_entry( &entry->hdr, &val, sizeof(val) ) == sizeof(DWORD)) entry->dword.val = val;
|
2012-11-13 15:10:05 +01:00
|
|
|
}
|
|
|
|
*(DWORD *)ptr_param = entry->bool.val;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* set a dword (binary) parameter in the registry */
|
|
|
|
static BOOL set_dword_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags )
|
|
|
|
{
|
|
|
|
DWORD val = PtrToUlong( ptr_param );
|
|
|
|
|
2012-11-14 13:22:25 +01:00
|
|
|
if (!save_entry( &entry->hdr, &val, sizeof(val), REG_DWORD, flags )) return FALSE;
|
2012-11-13 15:10:05 +01:00
|
|
|
entry->dword.val = val;
|
|
|
|
entry->hdr.loaded = TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2012-11-16 16:52:40 +01:00
|
|
|
/* initialize a dword parameter */
|
|
|
|
static BOOL init_dword_entry( union sysparam_all_entry *entry )
|
|
|
|
{
|
|
|
|
return init_entry( &entry->hdr, &entry->dword.val, sizeof(entry->dword.val), REG_DWORD );
|
|
|
|
}
|
|
|
|
|
2012-11-19 15:18:44 +01:00
|
|
|
/* load an RGB parameter from the registry */
|
|
|
|
static BOOL get_rgb_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param )
|
|
|
|
{
|
|
|
|
if (!ptr_param) return FALSE;
|
|
|
|
|
|
|
|
if (!entry->hdr.loaded)
|
|
|
|
{
|
|
|
|
WCHAR buf[32];
|
|
|
|
|
|
|
|
if (load_entry( &entry->hdr, buf, sizeof(buf) ))
|
|
|
|
{
|
|
|
|
DWORD r, g, b;
|
|
|
|
WCHAR *end, *str = buf;
|
|
|
|
|
|
|
|
r = strtoulW( str, &end, 10 );
|
|
|
|
if (end == str || !*end) goto done;
|
|
|
|
str = end + 1;
|
|
|
|
g = strtoulW( str, &end, 10 );
|
|
|
|
if (end == str || !*end) goto done;
|
|
|
|
str = end + 1;
|
|
|
|
b = strtoulW( str, &end, 10 );
|
|
|
|
if (end == str) goto done;
|
|
|
|
if (r > 255 || g > 255 || b > 255) goto done;
|
|
|
|
entry->rgb.val = RGB( r, g, b );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
done:
|
|
|
|
*(COLORREF *)ptr_param = entry->rgb.val;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* set an RGB parameter in the registry */
|
|
|
|
static BOOL set_rgb_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags )
|
|
|
|
{
|
|
|
|
WCHAR buf[32];
|
|
|
|
HBRUSH brush;
|
|
|
|
HPEN pen;
|
|
|
|
|
|
|
|
wsprintfW( buf, CSrgb, GetRValue(int_param), GetGValue(int_param), GetBValue(int_param) );
|
|
|
|
if (!save_entry_string( &entry->hdr, buf, flags )) return FALSE;
|
|
|
|
entry->rgb.val = int_param;
|
|
|
|
entry->hdr.loaded = TRUE;
|
|
|
|
if ((brush = InterlockedExchangePointer( (void **)&entry->rgb.brush, 0 )))
|
|
|
|
{
|
|
|
|
__wine_make_gdi_object_system( brush, FALSE );
|
|
|
|
DeleteObject( brush );
|
|
|
|
}
|
|
|
|
if ((pen = InterlockedExchangePointer( (void **)&entry->rgb.pen, 0 )))
|
|
|
|
{
|
|
|
|
__wine_make_gdi_object_system( pen, FALSE );
|
|
|
|
DeleteObject( pen );
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize an RGB parameter */
|
|
|
|
static BOOL init_rgb_entry( union sysparam_all_entry *entry )
|
|
|
|
{
|
|
|
|
WCHAR buf[32];
|
|
|
|
|
|
|
|
wsprintfW( buf, CSrgb, GetRValue(entry->rgb.val), GetGValue(entry->rgb.val), GetBValue(entry->rgb.val) );
|
|
|
|
return init_entry_string( &entry->hdr, buf );
|
|
|
|
}
|
|
|
|
|
2012-11-13 15:10:05 +01:00
|
|
|
/* load a font (binary) parameter from the registry */
|
|
|
|
static BOOL get_font_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param )
|
|
|
|
{
|
|
|
|
if (!ptr_param) return FALSE;
|
|
|
|
|
|
|
|
if (!entry->hdr.loaded)
|
|
|
|
{
|
|
|
|
LOGFONTW font;
|
|
|
|
|
2012-11-15 16:18:16 +01:00
|
|
|
switch (load_entry( &entry->hdr, &font, sizeof(font) ))
|
2012-11-15 13:28:22 +01:00
|
|
|
{
|
2012-11-15 16:18:16 +01:00
|
|
|
case sizeof(font):
|
|
|
|
if (font.lfHeight > 0) /* positive height value means points ( inch/72 ) */
|
|
|
|
font.lfHeight = -MulDiv( font.lfHeight, get_display_dpi(), 72 );
|
2012-12-15 21:59:09 +01:00
|
|
|
entry->font.val = font;
|
2012-11-15 16:18:16 +01:00
|
|
|
break;
|
|
|
|
case sizeof(LOGFONT16): /* win9x-winME format */
|
|
|
|
SYSPARAMS_LogFont16To32W( (LOGFONT16 *)&font, &entry->font.val );
|
|
|
|
if (entry->font.val.lfHeight > 0)
|
|
|
|
entry->font.val.lfHeight = -MulDiv( entry->font.val.lfHeight, get_display_dpi(), 72 );
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
WARN( "Unknown format in key %s value %s\n",
|
2012-11-16 12:22:31 +01:00
|
|
|
debugstr_w( parameter_key_names[entry->hdr.regval[0]] ),
|
|
|
|
debugstr_w( entry->hdr.regval + 1 ));
|
2012-11-15 16:18:16 +01:00
|
|
|
/* fall through */
|
|
|
|
case 0: /* use the default GUI font */
|
2012-11-15 13:28:22 +01:00
|
|
|
GetObjectW( GetStockObject( DEFAULT_GUI_FONT ), sizeof(font), &font );
|
|
|
|
font.lfWeight = entry->font.weight;
|
2012-11-15 16:18:16 +01:00
|
|
|
entry->font.val = font;
|
|
|
|
break;
|
2012-11-15 13:28:22 +01:00
|
|
|
}
|
2012-11-13 15:10:05 +01:00
|
|
|
entry->hdr.loaded = TRUE;
|
|
|
|
}
|
|
|
|
*(LOGFONTW *)ptr_param = entry->font.val;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* set a font (binary) parameter in the registry */
|
|
|
|
static BOOL set_font_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags )
|
|
|
|
{
|
|
|
|
LOGFONTW font;
|
|
|
|
WCHAR *ptr;
|
|
|
|
|
|
|
|
memcpy( &font, ptr_param, sizeof(font) );
|
|
|
|
/* zero pad the end of lfFaceName so we don't save uninitialised data */
|
|
|
|
ptr = memchrW( font.lfFaceName, 0, LF_FACESIZE );
|
|
|
|
if (ptr) memset( ptr, 0, (font.lfFaceName + LF_FACESIZE - ptr) * sizeof(WCHAR) );
|
|
|
|
|
2012-11-14 13:22:25 +01:00
|
|
|
if (!save_entry( &entry->hdr, &font, sizeof(font), REG_BINARY, flags )) return FALSE;
|
2012-11-13 15:10:05 +01:00
|
|
|
entry->font.val = font;
|
|
|
|
entry->hdr.loaded = TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2012-11-16 16:52:40 +01:00
|
|
|
/* initialize a font (binary) parameter */
|
|
|
|
static BOOL init_font_entry( union sysparam_all_entry *entry )
|
|
|
|
{
|
|
|
|
GetObjectW( GetStockObject( DEFAULT_GUI_FONT ), sizeof(entry->font.val), &entry->font.val );
|
|
|
|
entry->font.val.lfWeight = entry->font.weight;
|
|
|
|
return init_entry( &entry->hdr, &entry->font.val, sizeof(entry->font.val), REG_BINARY );
|
|
|
|
}
|
|
|
|
|
2012-11-15 15:54:52 +01:00
|
|
|
/* get a path parameter in the registry */
|
|
|
|
static BOOL get_path_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param )
|
|
|
|
{
|
|
|
|
if (!ptr_param) return FALSE;
|
|
|
|
|
|
|
|
if (!entry->hdr.loaded)
|
|
|
|
{
|
|
|
|
WCHAR buffer[MAX_PATH];
|
|
|
|
|
|
|
|
if (load_entry( &entry->hdr, buffer, sizeof(buffer) ))
|
|
|
|
lstrcpynW( entry->path.path, buffer, MAX_PATH );
|
|
|
|
}
|
|
|
|
lstrcpynW( ptr_param, entry->path.path, int_param );
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* set a path parameter in the registry */
|
|
|
|
static BOOL set_path_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags )
|
|
|
|
{
|
|
|
|
WCHAR buffer[MAX_PATH];
|
|
|
|
BOOL ret;
|
|
|
|
|
|
|
|
lstrcpynW( buffer, ptr_param, MAX_PATH );
|
|
|
|
ret = save_entry_string( &entry->hdr, buffer, flags );
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
strcpyW( entry->path.path, buffer );
|
|
|
|
entry->hdr.loaded = TRUE;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2012-11-16 16:52:40 +01:00
|
|
|
/* initialize a path parameter */
|
|
|
|
static BOOL init_path_entry( union sysparam_all_entry *entry )
|
|
|
|
{
|
|
|
|
return init_entry_string( &entry->hdr, entry->path.path );
|
|
|
|
}
|
|
|
|
|
2012-11-14 12:19:19 +01:00
|
|
|
/* get a binary parameter in the registry */
|
|
|
|
static BOOL get_binary_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param )
|
|
|
|
{
|
|
|
|
if (!ptr_param) return FALSE;
|
|
|
|
|
|
|
|
if (!entry->hdr.loaded)
|
|
|
|
{
|
|
|
|
void *buffer = HeapAlloc( GetProcessHeap(), 0, entry->bin.size );
|
2012-11-15 16:18:16 +01:00
|
|
|
DWORD len = load_entry( &entry->hdr, buffer, entry->bin.size );
|
2012-11-14 12:19:19 +01:00
|
|
|
|
2012-11-15 16:18:16 +01:00
|
|
|
if (len)
|
|
|
|
{
|
2012-11-14 12:19:19 +01:00
|
|
|
memcpy( entry->bin.ptr, buffer, entry->bin.size );
|
2012-11-15 16:18:16 +01:00
|
|
|
memset( (char *)entry->bin.ptr + len, 0, entry->bin.size - len );
|
|
|
|
}
|
2012-11-14 12:19:19 +01:00
|
|
|
HeapFree( GetProcessHeap(), 0, buffer );
|
|
|
|
}
|
|
|
|
memcpy( ptr_param, entry->bin.ptr, min( int_param, entry->bin.size ) );
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* set a binary parameter in the registry */
|
|
|
|
static BOOL set_binary_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags )
|
|
|
|
{
|
|
|
|
BOOL ret;
|
|
|
|
void *buffer = HeapAlloc( GetProcessHeap(), 0, entry->bin.size );
|
|
|
|
|
|
|
|
memcpy( buffer, entry->bin.ptr, entry->bin.size );
|
|
|
|
memcpy( buffer, ptr_param, min( int_param, entry->bin.size ));
|
2012-11-14 13:22:25 +01:00
|
|
|
ret = save_entry( &entry->hdr, buffer, entry->bin.size, REG_BINARY, flags );
|
2012-11-14 12:19:19 +01:00
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
memcpy( entry->bin.ptr, buffer, entry->bin.size );
|
|
|
|
entry->hdr.loaded = TRUE;
|
|
|
|
}
|
|
|
|
HeapFree( GetProcessHeap(), 0, buffer );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2012-11-16 16:52:40 +01:00
|
|
|
/* initialize a binary parameter */
|
|
|
|
static BOOL init_binary_entry( union sysparam_all_entry *entry )
|
|
|
|
{
|
|
|
|
return init_entry( &entry->hdr, entry->bin.ptr, entry->bin.size, REG_BINARY );
|
|
|
|
}
|
|
|
|
|
2012-11-14 12:19:19 +01:00
|
|
|
/* get a user pref parameter in the registry */
|
|
|
|
static BOOL get_userpref_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param )
|
|
|
|
{
|
|
|
|
union sysparam_all_entry *parent_entry = (union sysparam_all_entry *)entry->pref.parent;
|
2012-11-14 12:54:41 +01:00
|
|
|
BYTE prefs[8];
|
2012-11-14 12:19:19 +01:00
|
|
|
|
|
|
|
if (!ptr_param) return FALSE;
|
|
|
|
|
|
|
|
if (!parent_entry->hdr.get( parent_entry, sizeof(prefs), prefs )) return FALSE;
|
|
|
|
*(BOOL *)ptr_param = (prefs[entry->pref.offset] & entry->pref.mask) != 0;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* set a user pref parameter in the registry */
|
|
|
|
static BOOL set_userpref_entry( union sysparam_all_entry *entry, UINT int_param, void *ptr_param, UINT flags )
|
|
|
|
{
|
|
|
|
union sysparam_all_entry *parent_entry = (union sysparam_all_entry *)entry->pref.parent;
|
2012-11-14 12:54:41 +01:00
|
|
|
BYTE prefs[8];
|
2012-11-14 12:19:19 +01:00
|
|
|
|
|
|
|
parent_entry->hdr.loaded = FALSE; /* force loading it again */
|
|
|
|
if (!parent_entry->hdr.get( parent_entry, sizeof(prefs), prefs )) return FALSE;
|
|
|
|
|
|
|
|
if (PtrToUlong( ptr_param )) prefs[entry->pref.offset] |= entry->pref.mask;
|
|
|
|
else prefs[entry->pref.offset] &= ~entry->pref.mask;
|
|
|
|
|
|
|
|
return parent_entry->hdr.set( parent_entry, sizeof(prefs), prefs, flags );
|
|
|
|
}
|
|
|
|
|
2012-11-16 16:52:40 +01:00
|
|
|
static BOOL get_entry( void *ptr, UINT int_param, void *ptr_param )
|
2012-11-13 15:10:05 +01:00
|
|
|
{
|
|
|
|
union sysparam_all_entry *entry = ptr;
|
|
|
|
return entry->hdr.get( entry, int_param, ptr_param );
|
|
|
|
}
|
|
|
|
|
2012-11-16 16:52:40 +01:00
|
|
|
static BOOL set_entry( void *ptr, UINT int_param, void *ptr_param, UINT flags )
|
2012-11-13 15:10:05 +01:00
|
|
|
{
|
|
|
|
union sysparam_all_entry *entry = ptr;
|
|
|
|
return entry->hdr.set( entry, int_param, ptr_param, flags );
|
|
|
|
}
|
|
|
|
|
|
|
|
#define UINT_ENTRY(name,val) \
|
2012-11-16 16:52:40 +01:00
|
|
|
struct sysparam_uint_entry entry_##name = { { get_uint_entry, set_uint_entry, init_uint_entry, \
|
2012-11-16 12:22:31 +01:00
|
|
|
name ##_VALNAME }, (val) }
|
2012-11-13 15:10:05 +01:00
|
|
|
|
|
|
|
#define UINT_ENTRY_MIRROR(name,val) \
|
2012-11-16 16:52:40 +01:00
|
|
|
struct sysparam_uint_entry entry_##name = { { get_uint_entry, set_uint_entry, init_uint_entry, \
|
2012-11-16 12:22:31 +01:00
|
|
|
name ##_VALNAME, name ##_MIRROR }, (val) }
|
2012-11-13 15:10:05 +01:00
|
|
|
|
|
|
|
#define INT_ENTRY(name,val) \
|
2012-11-16 16:52:40 +01:00
|
|
|
struct sysparam_uint_entry entry_##name = { { get_uint_entry, set_int_entry, init_int_entry, \
|
2012-11-16 12:22:31 +01:00
|
|
|
name ##_VALNAME }, (val) }
|
2012-11-13 15:10:05 +01:00
|
|
|
|
|
|
|
#define BOOL_ENTRY(name,val) \
|
2012-11-16 16:52:40 +01:00
|
|
|
struct sysparam_bool_entry entry_##name = { { get_bool_entry, set_bool_entry, init_bool_entry, \
|
2012-11-16 12:22:31 +01:00
|
|
|
name ##_VALNAME }, (val) }
|
2012-11-13 15:10:05 +01:00
|
|
|
|
|
|
|
#define BOOL_ENTRY_MIRROR(name,val) \
|
2012-11-16 16:52:40 +01:00
|
|
|
struct sysparam_bool_entry entry_##name = { { get_bool_entry, set_bool_entry, init_bool_entry, \
|
2012-11-16 12:22:31 +01:00
|
|
|
name ##_VALNAME, name ##_MIRROR }, (val) }
|
2012-11-13 15:10:05 +01:00
|
|
|
|
|
|
|
#define YESNO_ENTRY(name,val) \
|
2012-11-16 16:52:40 +01:00
|
|
|
struct sysparam_bool_entry entry_##name = { { get_yesno_entry, set_yesno_entry, init_yesno_entry, \
|
2012-11-16 12:22:31 +01:00
|
|
|
name ##_VALNAME }, (val) }
|
2012-11-13 15:10:05 +01:00
|
|
|
|
|
|
|
#define TWIPS_ENTRY(name,val) \
|
2012-11-16 16:52:40 +01:00
|
|
|
struct sysparam_uint_entry entry_##name = { { get_twips_entry, set_int_entry, init_int_entry, \
|
2012-11-16 12:22:31 +01:00
|
|
|
name ##_VALNAME }, (val) }
|
2012-11-13 15:10:05 +01:00
|
|
|
|
|
|
|
#define DWORD_ENTRY(name,val) \
|
2012-11-16 16:52:40 +01:00
|
|
|
struct sysparam_dword_entry entry_##name = { { get_dword_entry, set_dword_entry, init_dword_entry, \
|
2012-11-16 12:22:31 +01:00
|
|
|
name ##_VALNAME }, (val) }
|
2012-11-13 15:10:05 +01:00
|
|
|
|
2012-11-14 12:19:19 +01:00
|
|
|
#define BINARY_ENTRY(name,data) \
|
2012-11-16 16:52:40 +01:00
|
|
|
struct sysparam_binary_entry entry_##name = { { get_binary_entry, set_binary_entry, init_binary_entry, \
|
2012-12-06 23:41:45 +01:00
|
|
|
name ##_VALNAME }, data, sizeof(data) }
|
2012-11-14 12:19:19 +01:00
|
|
|
|
2012-11-15 15:54:52 +01:00
|
|
|
#define PATH_ENTRY(name) \
|
2012-12-17 14:12:02 +01:00
|
|
|
struct sysparam_path_entry entry_##name = { { get_path_entry, set_path_entry, init_path_entry, \
|
|
|
|
name ##_VALNAME } }
|
2012-11-15 15:54:52 +01:00
|
|
|
|
2012-11-15 13:28:22 +01:00
|
|
|
#define FONT_ENTRY(name,weight) \
|
2012-11-16 16:52:40 +01:00
|
|
|
struct sysparam_font_entry entry_##name = { { get_font_entry, set_font_entry, init_font_entry, \
|
2012-11-16 12:22:31 +01:00
|
|
|
name ##_VALNAME }, (weight) }
|
2012-11-13 15:10:05 +01:00
|
|
|
|
2012-11-14 12:19:19 +01:00
|
|
|
#define USERPREF_ENTRY(name,offset,mask) \
|
|
|
|
struct sysparam_pref_entry entry_##name = { { get_userpref_entry, set_userpref_entry }, \
|
|
|
|
&entry_USERPREFERENCESMASK, (offset), (mask) }
|
|
|
|
|
2012-11-13 15:59:37 +01:00
|
|
|
static UINT_ENTRY( DRAGWIDTH, 4 );
|
|
|
|
static UINT_ENTRY( DRAGHEIGHT, 4 );
|
2012-11-13 15:10:05 +01:00
|
|
|
static UINT_ENTRY( DOUBLECLICKTIME, 500 );
|
2012-11-16 16:52:40 +01:00
|
|
|
static UINT_ENTRY( FONTSMOOTHING, 2 );
|
2012-11-13 15:10:05 +01:00
|
|
|
static UINT_ENTRY( GRIDGRANULARITY, 0 );
|
2012-11-15 13:28:54 +01:00
|
|
|
static UINT_ENTRY( ICONSIZE, 32 );
|
2012-11-13 15:10:05 +01:00
|
|
|
static UINT_ENTRY( KEYBOARDDELAY, 1 );
|
|
|
|
static UINT_ENTRY( KEYBOARDSPEED, 31 );
|
|
|
|
static UINT_ENTRY( MENUSHOWDELAY, 400 );
|
2012-11-15 13:28:54 +01:00
|
|
|
static UINT_ENTRY( MINARRANGE, ARW_HIDE );
|
|
|
|
static UINT_ENTRY( MINHORZGAP, 0 );
|
|
|
|
static UINT_ENTRY( MINVERTGAP, 0 );
|
|
|
|
static UINT_ENTRY( MINWIDTH, 154 );
|
2012-11-13 15:10:05 +01:00
|
|
|
static UINT_ENTRY( MOUSEHOVERHEIGHT, 4 );
|
|
|
|
static UINT_ENTRY( MOUSEHOVERTIME, 400 );
|
|
|
|
static UINT_ENTRY( MOUSEHOVERWIDTH, 4 );
|
|
|
|
static UINT_ENTRY( MOUSESPEED, 10 );
|
2012-11-13 15:59:37 +01:00
|
|
|
static UINT_ENTRY( MOUSETRAILS, 0 );
|
2012-11-13 15:10:05 +01:00
|
|
|
static UINT_ENTRY( SCREENSAVETIMEOUT, 300 );
|
|
|
|
static UINT_ENTRY( WHEELSCROLLCHARS, 3 );
|
|
|
|
static UINT_ENTRY( WHEELSCROLLLINES, 3 );
|
|
|
|
static UINT_ENTRY_MIRROR( DOUBLECLKHEIGHT, 4 );
|
|
|
|
static UINT_ENTRY_MIRROR( DOUBLECLKWIDTH, 4 );
|
|
|
|
static UINT_ENTRY_MIRROR( MENUDROPALIGNMENT, 0 );
|
|
|
|
|
|
|
|
static INT_ENTRY( MOUSETHRESHOLD1, 6 );
|
|
|
|
static INT_ENTRY( MOUSETHRESHOLD2, 10 );
|
|
|
|
static INT_ENTRY( MOUSEACCELERATION, 1 );
|
|
|
|
|
2012-11-13 15:59:37 +01:00
|
|
|
static BOOL_ENTRY( BLOCKSENDINPUTRESETS, FALSE );
|
2012-11-13 15:10:05 +01:00
|
|
|
static BOOL_ENTRY( DRAGFULLWINDOWS, FALSE );
|
|
|
|
static BOOL_ENTRY( KEYBOARDPREF, TRUE );
|
|
|
|
static BOOL_ENTRY( LOWPOWERACTIVE, FALSE );
|
|
|
|
static BOOL_ENTRY( MOUSEBUTTONSWAP, FALSE );
|
|
|
|
static BOOL_ENTRY( POWEROFFACTIVE, FALSE );
|
|
|
|
static BOOL_ENTRY( SCREENREADER, FALSE );
|
2012-11-15 17:38:21 +01:00
|
|
|
static BOOL_ENTRY( SCREENSAVEACTIVE, TRUE );
|
2012-11-13 15:10:05 +01:00
|
|
|
static BOOL_ENTRY( SCREENSAVERRUNNING, FALSE );
|
|
|
|
static BOOL_ENTRY( SHOWSOUNDS, FALSE );
|
|
|
|
static BOOL_ENTRY( SNAPTODEFBUTTON, FALSE );
|
|
|
|
static BOOL_ENTRY_MIRROR( ICONTITLEWRAP, TRUE );
|
|
|
|
|
|
|
|
static YESNO_ENTRY( BEEP, TRUE );
|
|
|
|
|
2013-06-17 14:35:47 +02:00
|
|
|
static TWIPS_ENTRY( BORDER, -15 );
|
|
|
|
static TWIPS_ENTRY( CAPTIONHEIGHT, -270 );
|
|
|
|
static TWIPS_ENTRY( CAPTIONWIDTH, -270 );
|
|
|
|
static TWIPS_ENTRY( ICONHORIZONTALSPACING, -1125 );
|
|
|
|
static TWIPS_ENTRY( ICONVERTICALSPACING, -1125 );
|
|
|
|
static TWIPS_ENTRY( MENUHEIGHT, -270 );
|
|
|
|
static TWIPS_ENTRY( MENUWIDTH, -270 );
|
2012-11-15 13:28:54 +01:00
|
|
|
static TWIPS_ENTRY( PADDEDBORDERWIDTH, 0 );
|
2013-06-17 14:35:47 +02:00
|
|
|
static TWIPS_ENTRY( SCROLLHEIGHT, -240 );
|
|
|
|
static TWIPS_ENTRY( SCROLLWIDTH, -240 );
|
|
|
|
static TWIPS_ENTRY( SMCAPTIONHEIGHT, -225 );
|
|
|
|
static TWIPS_ENTRY( SMCAPTIONWIDTH, -225 );
|
2012-11-13 15:10:05 +01:00
|
|
|
|
2012-11-13 15:59:37 +01:00
|
|
|
static DWORD_ENTRY( ACTIVEWINDOWTRACKING, 0 );
|
|
|
|
static DWORD_ENTRY( ACTIVEWNDTRKTIMEOUT, 0 );
|
2012-11-16 16:52:40 +01:00
|
|
|
static DWORD_ENTRY( CARETWIDTH, 1 );
|
2012-11-13 15:59:37 +01:00
|
|
|
static DWORD_ENTRY( FOCUSBORDERHEIGHT, 1 );
|
|
|
|
static DWORD_ENTRY( FOCUSBORDERWIDTH, 1 );
|
2012-11-13 15:10:05 +01:00
|
|
|
static DWORD_ENTRY( FONTSMOOTHINGCONTRAST, 0 );
|
2012-11-16 16:52:40 +01:00
|
|
|
static DWORD_ENTRY( FONTSMOOTHINGORIENTATION, FE_FONTSMOOTHINGORIENTATIONRGB );
|
|
|
|
static DWORD_ENTRY( FONTSMOOTHINGTYPE, FE_FONTSMOOTHINGSTANDARD );
|
2012-11-13 15:59:37 +01:00
|
|
|
static DWORD_ENTRY( FOREGROUNDFLASHCOUNT, 3 );
|
2012-11-13 15:10:05 +01:00
|
|
|
static DWORD_ENTRY( FOREGROUNDLOCKTIMEOUT, 0 );
|
2012-11-13 15:59:37 +01:00
|
|
|
static DWORD_ENTRY( MOUSECLICKLOCKTIME, 1200 );
|
2012-11-13 15:10:05 +01:00
|
|
|
|
2012-11-15 15:54:52 +01:00
|
|
|
static PATH_ENTRY( DESKPATTERN );
|
|
|
|
static PATH_ENTRY( DESKWALLPAPER );
|
|
|
|
|
2012-11-15 13:28:54 +01:00
|
|
|
static BYTE user_prefs[8] = { 0x30, 0x00, 0x00, 0x80, 0x10, 0x00, 0x00, 0x00 };
|
2012-11-14 12:19:19 +01:00
|
|
|
static BINARY_ENTRY( USERPREFERENCESMASK, user_prefs );
|
|
|
|
|
2012-11-15 13:28:54 +01:00
|
|
|
static FONT_ENTRY( CAPTIONLOGFONT, FW_BOLD );
|
2012-11-15 13:28:22 +01:00
|
|
|
static FONT_ENTRY( ICONTITLELOGFONT, FW_NORMAL );
|
2012-11-15 13:28:54 +01:00
|
|
|
static FONT_ENTRY( MENULOGFONT, FW_NORMAL );
|
|
|
|
static FONT_ENTRY( MESSAGELOGFONT, FW_NORMAL );
|
|
|
|
static FONT_ENTRY( SMCAPTIONLOGFONT, FW_NORMAL );
|
|
|
|
static FONT_ENTRY( STATUSLOGFONT, FW_NORMAL );
|
2012-11-13 15:10:05 +01:00
|
|
|
|
2012-11-14 12:54:41 +01:00
|
|
|
static USERPREF_ENTRY( MENUANIMATION, 0, 0x02 );
|
|
|
|
static USERPREF_ENTRY( COMBOBOXANIMATION, 0, 0x04 );
|
|
|
|
static USERPREF_ENTRY( LISTBOXSMOOTHSCROLLING, 0, 0x08 );
|
|
|
|
static USERPREF_ENTRY( GRADIENTCAPTIONS, 0, 0x10 );
|
|
|
|
static USERPREF_ENTRY( KEYBOARDCUES, 0, 0x20 );
|
|
|
|
static USERPREF_ENTRY( ACTIVEWNDTRKZORDER, 0, 0x40 );
|
|
|
|
static USERPREF_ENTRY( HOTTRACKING, 0, 0x80 );
|
|
|
|
static USERPREF_ENTRY( MENUFADE, 1, 0x02 );
|
|
|
|
static USERPREF_ENTRY( SELECTIONFADE, 1, 0x04 );
|
|
|
|
static USERPREF_ENTRY( TOOLTIPANIMATION, 1, 0x08 );
|
|
|
|
static USERPREF_ENTRY( TOOLTIPFADE, 1, 0x10 );
|
|
|
|
static USERPREF_ENTRY( CURSORSHADOW, 1, 0x20 );
|
|
|
|
static USERPREF_ENTRY( MOUSESONAR, 1, 0x40 );
|
|
|
|
static USERPREF_ENTRY( MOUSECLICKLOCK, 1, 0x80 );
|
|
|
|
static USERPREF_ENTRY( MOUSEVANISH, 2, 0x01 );
|
|
|
|
static USERPREF_ENTRY( FLATMENU, 2, 0x02 );
|
|
|
|
static USERPREF_ENTRY( DROPSHADOW, 2, 0x04 );
|
|
|
|
static USERPREF_ENTRY( UIEFFECTS, 3, 0x80 );
|
|
|
|
static USERPREF_ENTRY( DISABLEOVERLAPPEDCONTENT, 4, 0x01 );
|
|
|
|
static USERPREF_ENTRY( CLIENTAREAANIMATION, 4, 0x02 );
|
|
|
|
static USERPREF_ENTRY( CLEARTYPE, 4, 0x10 );
|
|
|
|
static USERPREF_ENTRY( SPEECHRECOGNITION, 4, 0x20 );
|
2012-11-14 12:19:19 +01:00
|
|
|
|
2012-11-19 15:18:44 +01:00
|
|
|
static struct sysparam_rgb_entry system_colors[] =
|
|
|
|
{
|
|
|
|
#define RGB_ENTRY(name,val) { { get_rgb_entry, set_rgb_entry, init_rgb_entry, name ##_VALNAME }, (val) }
|
|
|
|
RGB_ENTRY( COLOR_SCROLLBAR, RGB(212, 208, 200) ),
|
|
|
|
RGB_ENTRY( COLOR_BACKGROUND, RGB(58, 110, 165) ),
|
|
|
|
RGB_ENTRY( COLOR_ACTIVECAPTION, RGB(10, 36, 106) ),
|
|
|
|
RGB_ENTRY( COLOR_INACTIVECAPTION, RGB(128, 128, 128) ),
|
|
|
|
RGB_ENTRY( COLOR_MENU, RGB(212, 208, 200) ),
|
|
|
|
RGB_ENTRY( COLOR_WINDOW, RGB(255, 255, 255) ),
|
|
|
|
RGB_ENTRY( COLOR_WINDOWFRAME, RGB(0, 0, 0) ),
|
|
|
|
RGB_ENTRY( COLOR_MENUTEXT, RGB(0, 0, 0) ),
|
|
|
|
RGB_ENTRY( COLOR_WINDOWTEXT, RGB(0, 0, 0) ),
|
|
|
|
RGB_ENTRY( COLOR_CAPTIONTEXT, RGB(255, 255, 255) ),
|
|
|
|
RGB_ENTRY( COLOR_ACTIVEBORDER, RGB(212, 208, 200) ),
|
|
|
|
RGB_ENTRY( COLOR_INACTIVEBORDER, RGB(212, 208, 200) ),
|
|
|
|
RGB_ENTRY( COLOR_APPWORKSPACE, RGB(128, 128, 128) ),
|
|
|
|
RGB_ENTRY( COLOR_HIGHLIGHT, RGB(10, 36, 106) ),
|
|
|
|
RGB_ENTRY( COLOR_HIGHLIGHTTEXT, RGB(255, 255, 255) ),
|
|
|
|
RGB_ENTRY( COLOR_BTNFACE, RGB(212, 208, 200) ),
|
|
|
|
RGB_ENTRY( COLOR_BTNSHADOW, RGB(128, 128, 128) ),
|
|
|
|
RGB_ENTRY( COLOR_GRAYTEXT, RGB(128, 128, 128) ),
|
|
|
|
RGB_ENTRY( COLOR_BTNTEXT, RGB(0, 0, 0) ),
|
|
|
|
RGB_ENTRY( COLOR_INACTIVECAPTIONTEXT, RGB(212, 208, 200) ),
|
|
|
|
RGB_ENTRY( COLOR_BTNHIGHLIGHT, RGB(255, 255, 255) ),
|
|
|
|
RGB_ENTRY( COLOR_3DDKSHADOW, RGB(64, 64, 64) ),
|
|
|
|
RGB_ENTRY( COLOR_3DLIGHT, RGB(212, 208, 200) ),
|
|
|
|
RGB_ENTRY( COLOR_INFOTEXT, RGB(0, 0, 0) ),
|
|
|
|
RGB_ENTRY( COLOR_INFOBK, RGB(255, 255, 225) ),
|
|
|
|
RGB_ENTRY( COLOR_ALTERNATEBTNFACE, RGB(181, 181, 181) ),
|
|
|
|
RGB_ENTRY( COLOR_HOTLIGHT, RGB(0, 0, 200) ),
|
|
|
|
RGB_ENTRY( COLOR_GRADIENTACTIVECAPTION, RGB(166, 202, 240) ),
|
|
|
|
RGB_ENTRY( COLOR_GRADIENTINACTIVECAPTION, RGB(192, 192, 192) ),
|
|
|
|
RGB_ENTRY( COLOR_MENUHILIGHT, RGB(10, 36, 106) ),
|
|
|
|
RGB_ENTRY( COLOR_MENUBAR, RGB(212, 208, 200) )
|
|
|
|
#undef RGB_ENTRY
|
|
|
|
};
|
|
|
|
#define NUM_SYS_COLORS (sizeof(system_colors) / sizeof(system_colors[0]))
|
|
|
|
|
2012-11-16 16:52:40 +01:00
|
|
|
/* entries that are initialized by default in the registry */
|
|
|
|
static union sysparam_all_entry * const default_entries[] =
|
|
|
|
{
|
|
|
|
(union sysparam_all_entry *)&entry_ACTIVEWINDOWTRACKING,
|
|
|
|
(union sysparam_all_entry *)&entry_ACTIVEWNDTRKTIMEOUT,
|
|
|
|
(union sysparam_all_entry *)&entry_BEEP,
|
|
|
|
(union sysparam_all_entry *)&entry_BLOCKSENDINPUTRESETS,
|
|
|
|
(union sysparam_all_entry *)&entry_BORDER,
|
|
|
|
(union sysparam_all_entry *)&entry_CAPTIONHEIGHT,
|
|
|
|
(union sysparam_all_entry *)&entry_CAPTIONWIDTH,
|
|
|
|
(union sysparam_all_entry *)&entry_CARETWIDTH,
|
2012-12-03 13:28:08 +01:00
|
|
|
(union sysparam_all_entry *)&entry_DESKWALLPAPER,
|
2012-11-16 16:52:40 +01:00
|
|
|
(union sysparam_all_entry *)&entry_DOUBLECLICKTIME,
|
|
|
|
(union sysparam_all_entry *)&entry_DOUBLECLKHEIGHT,
|
|
|
|
(union sysparam_all_entry *)&entry_DOUBLECLKWIDTH,
|
|
|
|
(union sysparam_all_entry *)&entry_DRAGFULLWINDOWS,
|
|
|
|
(union sysparam_all_entry *)&entry_DRAGHEIGHT,
|
|
|
|
(union sysparam_all_entry *)&entry_DRAGWIDTH,
|
|
|
|
(union sysparam_all_entry *)&entry_FOCUSBORDERHEIGHT,
|
|
|
|
(union sysparam_all_entry *)&entry_FOCUSBORDERWIDTH,
|
|
|
|
(union sysparam_all_entry *)&entry_FONTSMOOTHING,
|
|
|
|
(union sysparam_all_entry *)&entry_FONTSMOOTHINGCONTRAST,
|
|
|
|
(union sysparam_all_entry *)&entry_FONTSMOOTHINGORIENTATION,
|
|
|
|
(union sysparam_all_entry *)&entry_FONTSMOOTHINGTYPE,
|
|
|
|
(union sysparam_all_entry *)&entry_FOREGROUNDFLASHCOUNT,
|
|
|
|
(union sysparam_all_entry *)&entry_FOREGROUNDLOCKTIMEOUT,
|
|
|
|
(union sysparam_all_entry *)&entry_ICONHORIZONTALSPACING,
|
|
|
|
(union sysparam_all_entry *)&entry_ICONSIZE,
|
|
|
|
(union sysparam_all_entry *)&entry_ICONTITLEWRAP,
|
|
|
|
(union sysparam_all_entry *)&entry_ICONVERTICALSPACING,
|
|
|
|
(union sysparam_all_entry *)&entry_KEYBOARDDELAY,
|
|
|
|
(union sysparam_all_entry *)&entry_KEYBOARDPREF,
|
|
|
|
(union sysparam_all_entry *)&entry_KEYBOARDSPEED,
|
|
|
|
(union sysparam_all_entry *)&entry_LOWPOWERACTIVE,
|
|
|
|
(union sysparam_all_entry *)&entry_MENUHEIGHT,
|
|
|
|
(union sysparam_all_entry *)&entry_MENUSHOWDELAY,
|
|
|
|
(union sysparam_all_entry *)&entry_MENUWIDTH,
|
|
|
|
(union sysparam_all_entry *)&entry_MOUSEACCELERATION,
|
|
|
|
(union sysparam_all_entry *)&entry_MOUSEBUTTONSWAP,
|
|
|
|
(union sysparam_all_entry *)&entry_MOUSECLICKLOCKTIME,
|
|
|
|
(union sysparam_all_entry *)&entry_MOUSEHOVERHEIGHT,
|
|
|
|
(union sysparam_all_entry *)&entry_MOUSEHOVERTIME,
|
|
|
|
(union sysparam_all_entry *)&entry_MOUSEHOVERWIDTH,
|
|
|
|
(union sysparam_all_entry *)&entry_MOUSESPEED,
|
|
|
|
(union sysparam_all_entry *)&entry_MOUSETHRESHOLD1,
|
|
|
|
(union sysparam_all_entry *)&entry_MOUSETHRESHOLD2,
|
|
|
|
(union sysparam_all_entry *)&entry_PADDEDBORDERWIDTH,
|
|
|
|
(union sysparam_all_entry *)&entry_SCREENREADER,
|
|
|
|
(union sysparam_all_entry *)&entry_SCROLLHEIGHT,
|
|
|
|
(union sysparam_all_entry *)&entry_SCROLLWIDTH,
|
|
|
|
(union sysparam_all_entry *)&entry_SHOWSOUNDS,
|
|
|
|
(union sysparam_all_entry *)&entry_SMCAPTIONHEIGHT,
|
|
|
|
(union sysparam_all_entry *)&entry_SMCAPTIONWIDTH,
|
|
|
|
(union sysparam_all_entry *)&entry_SNAPTODEFBUTTON,
|
|
|
|
(union sysparam_all_entry *)&entry_USERPREFERENCESMASK,
|
|
|
|
(union sysparam_all_entry *)&entry_WHEELSCROLLCHARS,
|
|
|
|
(union sysparam_all_entry *)&entry_WHEELSCROLLLINES,
|
|
|
|
};
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* SYSPARAMS_Init
|
|
|
|
*/
|
|
|
|
void SYSPARAMS_Init(void)
|
|
|
|
{
|
|
|
|
HKEY key;
|
|
|
|
DWORD i, dispos;
|
|
|
|
|
|
|
|
/* this one must be non-volatile */
|
|
|
|
if (RegCreateKeyW( HKEY_CURRENT_USER, WINE_CURRENT_USER_REGKEY, &key ))
|
|
|
|
{
|
|
|
|
ERR("Can't create wine registry branch\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* @@ Wine registry key: HKCU\Software\Wine\Temporary System Parameters */
|
|
|
|
if (RegCreateKeyExW( key, WINE_CURRENT_USER_REGKEY_TEMP_PARAMS, 0, 0,
|
|
|
|
REG_OPTION_VOLATILE, KEY_ALL_ACCESS, 0, &volatile_base_key, &dispos ))
|
|
|
|
ERR("Can't create non-permanent wine registry branch\n");
|
|
|
|
|
|
|
|
RegCloseKey( key );
|
|
|
|
|
|
|
|
if (volatile_base_key && dispos == REG_CREATED_NEW_KEY) /* first process, initialize entries */
|
|
|
|
{
|
|
|
|
for (i = 0; i < sizeof(default_entries)/sizeof(default_entries[0]); i++)
|
|
|
|
default_entries[i]->hdr.init( default_entries[i] );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-03 13:28:08 +01:00
|
|
|
static BOOL update_desktop_wallpaper(void)
|
|
|
|
{
|
|
|
|
DWORD pid;
|
|
|
|
|
|
|
|
if (GetWindowThreadProcessId( GetDesktopWindow(), &pid ) && pid == GetCurrentProcessId())
|
|
|
|
{
|
|
|
|
WCHAR wallpaper[MAX_PATH], pattern[256];
|
|
|
|
|
|
|
|
entry_DESKWALLPAPER.hdr.loaded = entry_DESKPATTERN.hdr.loaded = FALSE;
|
|
|
|
if (get_entry( &entry_DESKWALLPAPER, MAX_PATH, wallpaper ) &&
|
|
|
|
get_entry( &entry_DESKPATTERN, 256, pattern ))
|
|
|
|
update_wallpaper( wallpaper, pattern );
|
|
|
|
}
|
|
|
|
else SendMessageW( GetDesktopWindow(), WM_SETTINGCHANGE, SPI_SETDESKWALLPAPER, 0 );
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-03-18 23:12:33 +01:00
|
|
|
/***********************************************************************
|
2004-03-04 02:41:11 +01:00
|
|
|
* SystemParametersInfoW (USER32.@)
|
2001-11-07 21:24:29 +01:00
|
|
|
*
|
2001-11-20 21:27:26 +01:00
|
|
|
* Each system parameter has flag which shows whether the parameter
|
2001-11-07 21:24:29 +01:00
|
|
|
* is loaded or not. Parameters, stored directly in SysParametersInfo are
|
|
|
|
* loaded from registry only when they are requested and the flag is
|
|
|
|
* "false", after the loading the flag is set to "true". On interprocess
|
|
|
|
* notification of the parameter change the corresponding parameter flag is
|
|
|
|
* set to "false". The parameter value will be reloaded when it is requested
|
|
|
|
* the next time.
|
2001-11-20 21:27:26 +01:00
|
|
|
* Parameters, backed by or depend on GetSystemMetrics are processed
|
2001-11-07 21:24:29 +01:00
|
|
|
* differently. These parameters are always loaded. They are reloaded right
|
|
|
|
* away on interprocess change notification. We can't do lazy loading because
|
|
|
|
* we don't want to complicate GetSystemMetrics.
|
2001-11-20 21:27:26 +01:00
|
|
|
* Parameters, backed by X settings are read from corresponding setting.
|
|
|
|
* On the parameter change request the setting is changed. Interprocess change
|
|
|
|
* notifications are ignored.
|
|
|
|
* When parameter value is updated the changed value is stored in permanent
|
2001-11-07 21:24:29 +01:00
|
|
|
* registry branch if saving is requested. Otherwise it is stored
|
|
|
|
* in temporary branch
|
|
|
|
*
|
2003-02-19 23:04:46 +01:00
|
|
|
* Some SPI values can also be stored as Twips values in the registry,
|
|
|
|
* don't forget the conversion!
|
2000-03-18 23:12:33 +01:00
|
|
|
*/
|
2004-03-04 02:41:11 +01:00
|
|
|
BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
|
2000-11-05 04:18:47 +01:00
|
|
|
PVOID pvParam, UINT fWinIni )
|
2000-03-18 23:12:33 +01:00
|
|
|
{
|
2000-11-05 04:18:47 +01:00
|
|
|
#define WINE_SPI_FIXME(x) \
|
|
|
|
case x: \
|
2008-11-07 21:16:32 +01:00
|
|
|
{ \
|
|
|
|
static BOOL warn = TRUE; \
|
|
|
|
if (warn) \
|
|
|
|
{ \
|
|
|
|
warn = FALSE; \
|
|
|
|
FIXME( "Unimplemented action: %u (%s)\n", x, #x ); \
|
|
|
|
} \
|
|
|
|
} \
|
2000-11-05 04:18:47 +01:00
|
|
|
SetLastError( ERROR_INVALID_SPI_VALUE ); \
|
|
|
|
ret = FALSE; \
|
|
|
|
break
|
|
|
|
#define WINE_SPI_WARN(x) \
|
|
|
|
case x: \
|
|
|
|
WARN( "Ignored action: %u (%s)\n", x, #x ); \
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = TRUE; \
|
2000-11-05 04:18:47 +01:00
|
|
|
break
|
|
|
|
|
2012-11-15 17:38:21 +01:00
|
|
|
BOOL ret = USER_Driver->pSystemParametersInfo( uiAction, uiParam, pvParam, fWinIni );
|
2001-11-07 21:24:29 +01:00
|
|
|
unsigned spi_idx = 0;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2012-11-15 17:38:21 +01:00
|
|
|
if (!ret) switch (uiAction)
|
2000-11-05 04:18:47 +01:00
|
|
|
{
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_GETBEEP:
|
|
|
|
ret = get_entry( &entry_BEEP, uiParam, pvParam );
|
2000-11-05 04:18:47 +01:00
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_SETBEEP:
|
|
|
|
ret = set_entry( &entry_BEEP, uiParam, pvParam, fWinIni );
|
2001-11-07 21:24:29 +01:00
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_GETMOUSE:
|
|
|
|
ret = get_entry( &entry_MOUSETHRESHOLD1, uiParam, (INT *)pvParam ) &&
|
|
|
|
get_entry( &entry_MOUSETHRESHOLD2, uiParam, (INT *)pvParam + 1 ) &&
|
|
|
|
get_entry( &entry_MOUSEACCELERATION, uiParam, (INT *)pvParam + 2 );
|
2001-11-13 22:30:59 +01:00
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_SETMOUSE:
|
|
|
|
ret = set_entry( &entry_MOUSETHRESHOLD1, ((INT *)pvParam)[0], pvParam, fWinIni ) &&
|
|
|
|
set_entry( &entry_MOUSETHRESHOLD2, ((INT *)pvParam)[1], pvParam, fWinIni ) &&
|
|
|
|
set_entry( &entry_MOUSEACCELERATION, ((INT *)pvParam)[2], pvParam, fWinIni );
|
2001-11-13 22:30:59 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETBORDER:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_BORDER, uiParam, pvParam );
|
|
|
|
if (*(INT*)pvParam < 1) *(INT*)pvParam = 1;
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETBORDER:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_BORDER, uiParam, pvParam, fWinIni );
|
2001-11-07 21:24:29 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETKEYBOARDSPEED:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_KEYBOARDSPEED, uiParam, pvParam );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETKEYBOARDSPEED:
|
|
|
|
if (uiParam > 31) uiParam = 31;
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_KEYBOARDSPEED, uiParam, pvParam, fWinIni );
|
2001-11-13 22:30:59 +01:00
|
|
|
break;
|
2000-11-05 04:18:47 +01:00
|
|
|
|
2001-11-20 21:27:26 +01:00
|
|
|
/* not implemented in Windows */
|
|
|
|
WINE_SPI_WARN(SPI_LANGDRIVER); /* 12 */
|
2000-11-05 04:18:47 +01:00
|
|
|
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_ICONHORIZONTALSPACING:
|
|
|
|
if (pvParam != NULL)
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_ICONHORIZONTALSPACING, uiParam, pvParam );
|
2005-07-15 18:35:27 +02:00
|
|
|
else
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_ICONHORIZONTALSPACING, max( 32, uiParam ), pvParam, fWinIni );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_GETSCREENSAVETIMEOUT:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_SCREENSAVETIMEOUT, uiParam, pvParam );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETSCREENSAVETIMEOUT:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_SCREENSAVETIMEOUT, uiParam, pvParam, fWinIni );
|
2001-11-20 21:27:26 +01:00
|
|
|
break;
|
2012-11-15 17:38:21 +01:00
|
|
|
case SPI_GETSCREENSAVEACTIVE:
|
|
|
|
ret = get_entry( &entry_SCREENSAVEACTIVE, uiParam, pvParam );
|
2001-11-20 21:27:26 +01:00
|
|
|
break;
|
2012-11-15 17:38:21 +01:00
|
|
|
case SPI_SETSCREENSAVEACTIVE:
|
|
|
|
ret = set_entry( &entry_SCREENSAVEACTIVE, uiParam, pvParam, fWinIni );
|
2001-11-20 21:27:26 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETGRIDGRANULARITY:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_GRIDGRANULARITY, uiParam, pvParam );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETGRIDGRANULARITY:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_GRIDGRANULARITY, uiParam, pvParam, fWinIni );
|
2001-12-06 23:28:43 +01:00
|
|
|
break;
|
2012-11-15 15:54:52 +01:00
|
|
|
case SPI_SETDESKWALLPAPER:
|
2012-12-03 13:28:08 +01:00
|
|
|
if (!pvParam || set_entry( &entry_DESKWALLPAPER, uiParam, pvParam, fWinIni ))
|
|
|
|
ret = update_desktop_wallpaper();
|
2012-11-15 15:54:52 +01:00
|
|
|
break;
|
|
|
|
case SPI_SETDESKPATTERN:
|
|
|
|
if (!pvParam || set_entry( &entry_DESKPATTERN, uiParam, pvParam, fWinIni ))
|
2012-12-03 13:28:08 +01:00
|
|
|
ret = update_desktop_wallpaper();
|
2012-11-15 15:54:52 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETKEYBOARDDELAY:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_KEYBOARDDELAY, uiParam, pvParam );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETKEYBOARDDELAY:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_KEYBOARDDELAY, uiParam, pvParam, fWinIni );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_ICONVERTICALSPACING:
|
|
|
|
if (pvParam != NULL)
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_ICONVERTICALSPACING, uiParam, pvParam );
|
2005-07-15 18:35:27 +02:00
|
|
|
else
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_ICONVERTICALSPACING, max( 32, uiParam ), pvParam, fWinIni );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_GETICONTITLEWRAP:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_ICONTITLEWRAP, uiParam, pvParam );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETICONTITLEWRAP:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_ICONTITLEWRAP, uiParam, pvParam, fWinIni );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_GETMENUDROPALIGNMENT:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_MENUDROPALIGNMENT, uiParam, pvParam );
|
2001-11-13 22:30:59 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_SETMENUDROPALIGNMENT:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_MENUDROPALIGNMENT, uiParam, pvParam, fWinIni );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETDOUBLECLKWIDTH:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_DOUBLECLKWIDTH, uiParam, pvParam, fWinIni );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETDOUBLECLKHEIGHT:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_DOUBLECLKHEIGHT, uiParam, pvParam, fWinIni );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
2005-07-18 11:20:07 +02:00
|
|
|
case SPI_GETICONTITLELOGFONT:
|
2012-11-15 13:28:22 +01:00
|
|
|
ret = get_entry( &entry_ICONTITLELOGFONT, uiParam, pvParam );
|
2005-07-18 11:20:07 +02:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_SETDOUBLECLICKTIME:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_DOUBLECLICKTIME, uiParam, pvParam, fWinIni );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETMOUSEBUTTONSWAP:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_MOUSEBUTTONSWAP, uiParam, pvParam, fWinIni );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_SETICONTITLELOGFONT:
|
|
|
|
ret = set_entry( &entry_ICONTITLELOGFONT, uiParam, pvParam, fWinIni );
|
2005-11-14 16:12:14 +01:00
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETFASTTASKSWITCH: /* 35 */
|
|
|
|
if (!pvParam) return FALSE;
|
2014-02-19 22:13:30 +01:00
|
|
|
*(BOOL *)pvParam = TRUE;
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = TRUE;
|
2001-12-21 21:31:24 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SPI_SETFASTTASKSWITCH: /* 36 */
|
2002-01-15 21:43:43 +01:00
|
|
|
/* the action is disabled */
|
2002-01-18 19:10:11 +01:00
|
|
|
ret = FALSE;
|
2001-12-21 21:31:24 +01:00
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_SETDRAGFULLWINDOWS:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_DRAGFULLWINDOWS, uiParam, pvParam, fWinIni );
|
2001-12-21 21:31:24 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETDRAGFULLWINDOWS:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_DRAGFULLWINDOWS, uiParam, pvParam );
|
2001-12-21 21:31:24 +01:00
|
|
|
break;
|
2005-07-18 11:20:07 +02:00
|
|
|
case SPI_GETNONCLIENTMETRICS:
|
2000-11-05 04:18:47 +01:00
|
|
|
{
|
2005-07-18 11:20:07 +02:00
|
|
|
LPNONCLIENTMETRICSW lpnm = pvParam;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2012-11-15 13:28:54 +01:00
|
|
|
if (!pvParam) return FALSE;
|
2003-08-22 07:00:45 +02:00
|
|
|
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = get_entry( &entry_BORDER, 0, &lpnm->iBorderWidth ) &&
|
|
|
|
get_entry( &entry_SCROLLWIDTH, 0, &lpnm->iScrollWidth ) &&
|
|
|
|
get_entry( &entry_SCROLLHEIGHT, 0, &lpnm->iScrollHeight ) &&
|
|
|
|
get_entry( &entry_CAPTIONWIDTH, 0, &lpnm->iCaptionWidth ) &&
|
|
|
|
get_entry( &entry_CAPTIONHEIGHT, 0, &lpnm->iCaptionHeight ) &&
|
|
|
|
get_entry( &entry_CAPTIONLOGFONT, 0, &lpnm->lfCaptionFont ) &&
|
|
|
|
get_entry( &entry_SMCAPTIONWIDTH, 0, &lpnm->iSmCaptionWidth ) &&
|
|
|
|
get_entry( &entry_SMCAPTIONHEIGHT, 0, &lpnm->iSmCaptionHeight ) &&
|
|
|
|
get_entry( &entry_SMCAPTIONLOGFONT, 0, &lpnm->lfSmCaptionFont ) &&
|
|
|
|
get_entry( &entry_MENUWIDTH, 0, &lpnm->iMenuWidth ) &&
|
|
|
|
get_entry( &entry_MENUHEIGHT, 0, &lpnm->iMenuHeight ) &&
|
|
|
|
get_entry( &entry_MENULOGFONT, 0, &lpnm->lfMenuFont ) &&
|
|
|
|
get_entry( &entry_STATUSLOGFONT, 0, &lpnm->lfStatusFont ) &&
|
|
|
|
get_entry( &entry_MESSAGELOGFONT, 0, &lpnm->lfMessageFont );
|
|
|
|
if (ret && lpnm->cbSize == sizeof(NONCLIENTMETRICSW))
|
|
|
|
ret = get_entry( &entry_PADDEDBORDERWIDTH, 0, &lpnm->iPaddedBorderWidth );
|
2012-11-15 13:28:54 +01:00
|
|
|
normalize_nonclientmetrics( lpnm );
|
2005-07-18 11:20:07 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SPI_SETNONCLIENTMETRICS:
|
|
|
|
{
|
|
|
|
LPNONCLIENTMETRICSW lpnm = pvParam;
|
2004-09-24 03:11:02 +02:00
|
|
|
|
2011-10-08 13:11:34 +02:00
|
|
|
if (lpnm && (lpnm->cbSize == sizeof(NONCLIENTMETRICSW) ||
|
|
|
|
lpnm->cbSize == FIELD_OFFSET(NONCLIENTMETRICSW, iPaddedBorderWidth)))
|
2005-07-18 11:20:07 +02:00
|
|
|
{
|
2012-11-15 13:28:54 +01:00
|
|
|
ret = set_entry( &entry_BORDER, lpnm->iBorderWidth, NULL, fWinIni ) &&
|
|
|
|
set_entry( &entry_SCROLLWIDTH, lpnm->iScrollWidth, NULL, fWinIni ) &&
|
|
|
|
set_entry( &entry_SCROLLHEIGHT, lpnm->iScrollHeight, NULL, fWinIni ) &&
|
|
|
|
set_entry( &entry_CAPTIONWIDTH, lpnm->iCaptionWidth, NULL, fWinIni ) &&
|
|
|
|
set_entry( &entry_CAPTIONHEIGHT, lpnm->iCaptionHeight, NULL, fWinIni ) &&
|
|
|
|
set_entry( &entry_SMCAPTIONWIDTH, lpnm->iSmCaptionWidth, NULL, fWinIni ) &&
|
|
|
|
set_entry( &entry_SMCAPTIONHEIGHT, lpnm->iSmCaptionHeight, NULL, fWinIni ) &&
|
|
|
|
set_entry( &entry_MENUWIDTH, lpnm->iMenuWidth, NULL, fWinIni ) &&
|
|
|
|
set_entry( &entry_MENUHEIGHT, lpnm->iMenuHeight, NULL, fWinIni ) &&
|
|
|
|
set_entry( &entry_MENULOGFONT, 0, &lpnm->lfMenuFont, fWinIni ) &&
|
|
|
|
set_entry( &entry_CAPTIONLOGFONT, 0, &lpnm->lfCaptionFont, fWinIni ) &&
|
|
|
|
set_entry( &entry_SMCAPTIONLOGFONT, 0, &lpnm->lfSmCaptionFont, fWinIni ) &&
|
|
|
|
set_entry( &entry_STATUSLOGFONT, 0, &lpnm->lfStatusFont, fWinIni ) &&
|
|
|
|
set_entry( &entry_MESSAGELOGFONT, 0, &lpnm->lfMessageFont, fWinIni );
|
|
|
|
|
|
|
|
if (ret && lpnm->cbSize == sizeof(NONCLIENTMETRICSW))
|
|
|
|
set_entry( &entry_PADDEDBORDERWIDTH, lpnm->iPaddedBorderWidth, NULL, fWinIni );
|
2005-07-18 11:20:07 +02:00
|
|
|
}
|
|
|
|
break;
|
2000-11-05 04:18:47 +01:00
|
|
|
}
|
2005-07-18 11:20:07 +02:00
|
|
|
case SPI_GETMINIMIZEDMETRICS:
|
2003-01-13 19:29:03 +01:00
|
|
|
{
|
|
|
|
MINIMIZEDMETRICS * lpMm = pvParam;
|
2005-12-14 12:27:39 +01:00
|
|
|
if (lpMm && lpMm->cbSize == sizeof(*lpMm)) {
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = get_entry( &entry_MINWIDTH, 0, &lpMm->iWidth ) &&
|
|
|
|
get_entry( &entry_MINHORZGAP, 0, &lpMm->iHorzGap ) &&
|
|
|
|
get_entry( &entry_MINVERTGAP, 0, &lpMm->iVertGap ) &&
|
|
|
|
get_entry( &entry_MINARRANGE, 0, &lpMm->iArrange );
|
2012-11-13 15:10:05 +01:00
|
|
|
lpMm->iWidth = max( 0, lpMm->iWidth );
|
|
|
|
lpMm->iHorzGap = max( 0, lpMm->iHorzGap );
|
|
|
|
lpMm->iVertGap = max( 0, lpMm->iVertGap );
|
|
|
|
lpMm->iArrange &= 0x0f;
|
2012-11-15 17:38:21 +01:00
|
|
|
}
|
2005-07-18 11:20:07 +02:00
|
|
|
break;
|
2005-01-14 17:49:12 +01:00
|
|
|
}
|
2005-07-18 11:20:07 +02:00
|
|
|
case SPI_SETMINIMIZEDMETRICS:
|
2005-01-14 17:49:12 +01:00
|
|
|
{
|
|
|
|
MINIMIZEDMETRICS * lpMm = pvParam;
|
2012-11-13 15:10:05 +01:00
|
|
|
if (lpMm && lpMm->cbSize == sizeof(*lpMm))
|
2012-11-15 13:28:54 +01:00
|
|
|
ret = set_entry( &entry_MINWIDTH, max( 0, lpMm->iWidth ), NULL, fWinIni ) &&
|
|
|
|
set_entry( &entry_MINHORZGAP, max( 0, lpMm->iHorzGap ), NULL, fWinIni ) &&
|
|
|
|
set_entry( &entry_MINVERTGAP, max( 0, lpMm->iVertGap ), NULL, fWinIni ) &&
|
|
|
|
set_entry( &entry_MINARRANGE, lpMm->iArrange & 0x0f, NULL, fWinIni );
|
2005-07-18 11:20:07 +02:00
|
|
|
break;
|
2003-01-13 19:29:03 +01:00
|
|
|
}
|
2005-07-18 11:20:07 +02:00
|
|
|
case SPI_GETICONMETRICS:
|
2000-11-05 04:18:47 +01:00
|
|
|
{
|
2004-03-04 02:41:11 +01:00
|
|
|
LPICONMETRICSW lpIcon = pvParam;
|
2000-11-05 04:18:47 +01:00
|
|
|
if(lpIcon && lpIcon->cbSize == sizeof(*lpIcon))
|
|
|
|
{
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = get_entry( &entry_ICONHORIZONTALSPACING, 0, &lpIcon->iHorzSpacing ) &&
|
|
|
|
get_entry( &entry_ICONVERTICALSPACING, 0, &lpIcon->iVertSpacing ) &&
|
|
|
|
get_entry( &entry_ICONTITLEWRAP, 0, &lpIcon->iTitleWrap ) &&
|
|
|
|
get_entry( &entry_ICONTITLELOGFONT, 0, &lpIcon->lfFont );
|
2000-11-05 04:18:47 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2005-07-18 11:20:07 +02:00
|
|
|
case SPI_SETICONMETRICS:
|
2005-01-20 21:43:02 +01:00
|
|
|
{
|
2005-07-18 11:20:07 +02:00
|
|
|
LPICONMETRICSW lpIcon = pvParam;
|
2012-11-13 15:10:05 +01:00
|
|
|
if (lpIcon && lpIcon->cbSize == sizeof(*lpIcon))
|
|
|
|
ret = set_entry( &entry_ICONVERTICALSPACING, max(32,lpIcon->iVertSpacing), NULL, fWinIni ) &&
|
|
|
|
set_entry( &entry_ICONHORIZONTALSPACING, max(32,lpIcon->iHorzSpacing), NULL, fWinIni ) &&
|
|
|
|
set_entry( &entry_ICONTITLEWRAP, lpIcon->iTitleWrap, NULL, fWinIni ) &&
|
|
|
|
set_entry( &entry_ICONTITLELOGFONT, 0, &lpIcon->lfFont, fWinIni );
|
2005-07-18 11:20:07 +02:00
|
|
|
break;
|
2005-01-20 21:43:02 +01:00
|
|
|
}
|
2000-03-18 23:12:33 +01:00
|
|
|
|
2001-12-21 21:31:24 +01:00
|
|
|
case SPI_SETWORKAREA: /* 47 WINVER >= 0x400 */
|
|
|
|
{
|
2003-08-22 07:00:45 +02:00
|
|
|
if (!pvParam) return FALSE;
|
|
|
|
|
2001-12-21 21:31:24 +01:00
|
|
|
spi_idx = SPI_SETWORKAREA_IDX;
|
2009-03-02 10:24:30 +01:00
|
|
|
CopyRect( &work_area, pvParam );
|
2005-02-01 19:47:05 +01:00
|
|
|
spi_loaded[spi_idx] = TRUE;
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = TRUE;
|
2001-12-21 21:31:24 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case SPI_GETWORKAREA: /* 48 WINVER >= 0x400 */
|
2005-02-01 19:47:05 +01:00
|
|
|
{
|
2003-08-22 07:00:45 +02:00
|
|
|
if (!pvParam) return FALSE;
|
|
|
|
|
2005-02-01 19:47:05 +01:00
|
|
|
spi_idx = SPI_SETWORKAREA_IDX;
|
|
|
|
if (!spi_loaded[spi_idx])
|
|
|
|
{
|
|
|
|
SetRect( &work_area, 0, 0,
|
|
|
|
GetSystemMetrics( SM_CXSCREEN ),
|
|
|
|
GetSystemMetrics( SM_CYSCREEN ) );
|
2008-09-11 06:20:15 +02:00
|
|
|
EnumDisplayMonitors( 0, NULL, enum_monitors, (LPARAM)&work_area );
|
2005-02-01 19:47:05 +01:00
|
|
|
spi_loaded[spi_idx] = TRUE;
|
|
|
|
}
|
2009-03-02 10:24:30 +01:00
|
|
|
CopyRect( pvParam, &work_area );
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = TRUE;
|
2008-09-11 06:20:15 +02:00
|
|
|
TRACE("work area %s\n", wine_dbgstr_rect( &work_area ));
|
2005-02-01 19:47:05 +01:00
|
|
|
break;
|
|
|
|
}
|
2001-12-21 21:31:24 +01:00
|
|
|
|
2000-11-05 04:18:47 +01:00
|
|
|
WINE_SPI_FIXME(SPI_SETPENWINDOWS); /* 49 WINVER >= 0x400 */
|
|
|
|
|
2001-12-27 00:39:50 +01:00
|
|
|
case SPI_GETFILTERKEYS: /* 50 */
|
|
|
|
{
|
2009-03-02 10:24:30 +01:00
|
|
|
LPFILTERKEYS lpFilterKeys = pvParam;
|
2001-12-27 00:39:50 +01:00
|
|
|
WARN("SPI_GETFILTERKEYS not fully implemented\n");
|
2003-08-22 07:00:45 +02:00
|
|
|
if (lpFilterKeys && lpFilterKeys->cbSize == sizeof(FILTERKEYS))
|
2001-12-27 00:39:50 +01:00
|
|
|
{
|
|
|
|
/* Indicate that no FilterKeys feature available */
|
|
|
|
lpFilterKeys->dwFlags = 0;
|
|
|
|
lpFilterKeys->iWaitMSec = 0;
|
|
|
|
lpFilterKeys->iDelayMSec = 0;
|
|
|
|
lpFilterKeys->iRepeatMSec = 0;
|
|
|
|
lpFilterKeys->iBounceMSec = 0;
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = TRUE;
|
2001-12-27 00:39:50 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2000-11-05 04:18:47 +01:00
|
|
|
WINE_SPI_FIXME(SPI_SETFILTERKEYS); /* 51 */
|
2001-12-27 00:39:50 +01:00
|
|
|
|
|
|
|
case SPI_GETTOGGLEKEYS: /* 52 */
|
|
|
|
{
|
2009-03-02 10:24:30 +01:00
|
|
|
LPTOGGLEKEYS lpToggleKeys = pvParam;
|
2001-12-27 00:39:50 +01:00
|
|
|
WARN("SPI_GETTOGGLEKEYS not fully implemented\n");
|
2003-08-22 07:00:45 +02:00
|
|
|
if (lpToggleKeys && lpToggleKeys->cbSize == sizeof(TOGGLEKEYS))
|
2001-12-27 00:39:50 +01:00
|
|
|
{
|
|
|
|
/* Indicate that no ToggleKeys feature available */
|
|
|
|
lpToggleKeys->dwFlags = 0;
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = TRUE;
|
2001-12-27 00:39:50 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2000-11-05 04:18:47 +01:00
|
|
|
WINE_SPI_FIXME(SPI_SETTOGGLEKEYS); /* 53 */
|
2001-12-27 00:39:50 +01:00
|
|
|
|
|
|
|
case SPI_GETMOUSEKEYS: /* 54 */
|
|
|
|
{
|
2009-03-02 10:24:30 +01:00
|
|
|
LPMOUSEKEYS lpMouseKeys = pvParam;
|
2001-12-27 00:39:50 +01:00
|
|
|
WARN("SPI_GETMOUSEKEYS not fully implemented\n");
|
2003-08-22 07:00:45 +02:00
|
|
|
if (lpMouseKeys && lpMouseKeys->cbSize == sizeof(MOUSEKEYS))
|
2001-12-27 00:39:50 +01:00
|
|
|
{
|
|
|
|
/* Indicate that no MouseKeys feature available */
|
|
|
|
lpMouseKeys->dwFlags = 0;
|
|
|
|
lpMouseKeys->iMaxSpeed = 360;
|
|
|
|
lpMouseKeys->iTimeToMaxSpeed = 1000;
|
|
|
|
lpMouseKeys->iCtrlSpeed = 0;
|
|
|
|
lpMouseKeys->dwReserved1 = 0;
|
|
|
|
lpMouseKeys->dwReserved2 = 0;
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = TRUE;
|
2001-12-27 00:39:50 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2000-11-05 04:18:47 +01:00
|
|
|
WINE_SPI_FIXME(SPI_SETMOUSEKEYS); /* 55 */
|
2001-12-27 00:39:50 +01:00
|
|
|
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETSHOWSOUNDS:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_SHOWSOUNDS, uiParam, pvParam );
|
2001-10-02 20:35:32 +02:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_SETSHOWSOUNDS:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_SHOWSOUNDS, uiParam, pvParam, fWinIni );
|
2001-10-02 20:35:32 +02:00
|
|
|
break;
|
2001-12-27 00:39:50 +01:00
|
|
|
|
|
|
|
case SPI_GETSTICKYKEYS: /* 58 */
|
|
|
|
{
|
2009-03-02 10:24:30 +01:00
|
|
|
LPSTICKYKEYS lpStickyKeys = pvParam;
|
2001-12-27 00:39:50 +01:00
|
|
|
WARN("SPI_GETSTICKYKEYS not fully implemented\n");
|
2003-08-22 07:00:45 +02:00
|
|
|
if (lpStickyKeys && lpStickyKeys->cbSize == sizeof(STICKYKEYS))
|
2001-12-27 00:39:50 +01:00
|
|
|
{
|
|
|
|
/* Indicate that no StickyKeys feature available */
|
|
|
|
lpStickyKeys->dwFlags = 0;
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = TRUE;
|
2001-12-27 00:39:50 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2000-11-05 04:18:47 +01:00
|
|
|
WINE_SPI_FIXME(SPI_SETSTICKYKEYS); /* 59 */
|
2001-12-27 00:39:50 +01:00
|
|
|
|
|
|
|
case SPI_GETACCESSTIMEOUT: /* 60 */
|
|
|
|
{
|
2009-03-02 10:24:30 +01:00
|
|
|
LPACCESSTIMEOUT lpAccessTimeout = pvParam;
|
2001-12-27 00:39:50 +01:00
|
|
|
WARN("SPI_GETACCESSTIMEOUT not fully implemented\n");
|
2003-08-22 07:00:45 +02:00
|
|
|
if (lpAccessTimeout && lpAccessTimeout->cbSize == sizeof(ACCESSTIMEOUT))
|
2001-12-27 00:39:50 +01:00
|
|
|
{
|
|
|
|
/* Indicate that no accessibility features timeout is available */
|
|
|
|
lpAccessTimeout->dwFlags = 0;
|
|
|
|
lpAccessTimeout->iTimeOutMSec = 0;
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = TRUE;
|
2001-12-27 00:39:50 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2000-11-05 04:18:47 +01:00
|
|
|
WINE_SPI_FIXME(SPI_SETACCESSTIMEOUT); /* 61 */
|
|
|
|
|
2001-12-27 00:39:50 +01:00
|
|
|
case SPI_GETSERIALKEYS: /* 62 WINVER >= 0x400 */
|
|
|
|
{
|
2009-03-02 10:24:30 +01:00
|
|
|
LPSERIALKEYSW lpSerialKeysW = pvParam;
|
2001-12-27 00:39:50 +01:00
|
|
|
WARN("SPI_GETSERIALKEYS not fully implemented\n");
|
2004-03-04 02:41:11 +01:00
|
|
|
if (lpSerialKeysW && lpSerialKeysW->cbSize == sizeof(SERIALKEYSW))
|
2001-12-27 00:39:50 +01:00
|
|
|
{
|
|
|
|
/* Indicate that no SerialKeys feature available */
|
2004-03-04 02:41:11 +01:00
|
|
|
lpSerialKeysW->dwFlags = 0;
|
|
|
|
lpSerialKeysW->lpszActivePort = NULL;
|
|
|
|
lpSerialKeysW->lpszPort = NULL;
|
|
|
|
lpSerialKeysW->iBaudRate = 0;
|
|
|
|
lpSerialKeysW->iPortState = 0;
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = TRUE;
|
2001-12-27 00:39:50 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2000-11-05 04:18:47 +01:00
|
|
|
WINE_SPI_FIXME(SPI_SETSERIALKEYS); /* 63 WINVER >= 0x400 */
|
|
|
|
|
2001-12-27 00:39:50 +01:00
|
|
|
case SPI_GETSOUNDSENTRY: /* 64 */
|
|
|
|
{
|
2009-03-02 10:24:30 +01:00
|
|
|
LPSOUNDSENTRYW lpSoundSentryW = pvParam;
|
2001-12-27 00:39:50 +01:00
|
|
|
WARN("SPI_GETSOUNDSENTRY not fully implemented\n");
|
2004-03-04 02:41:11 +01:00
|
|
|
if (lpSoundSentryW && lpSoundSentryW->cbSize == sizeof(SOUNDSENTRYW))
|
2001-12-27 00:39:50 +01:00
|
|
|
{
|
|
|
|
/* Indicate that no SoundSentry feature available */
|
2004-03-04 02:41:11 +01:00
|
|
|
lpSoundSentryW->dwFlags = 0;
|
|
|
|
lpSoundSentryW->iFSTextEffect = 0;
|
|
|
|
lpSoundSentryW->iFSTextEffectMSec = 0;
|
|
|
|
lpSoundSentryW->iFSTextEffectColorBits = 0;
|
|
|
|
lpSoundSentryW->iFSGrafEffect = 0;
|
|
|
|
lpSoundSentryW->iFSGrafEffectMSec = 0;
|
|
|
|
lpSoundSentryW->iFSGrafEffectColor = 0;
|
|
|
|
lpSoundSentryW->iWindowsEffect = 0;
|
|
|
|
lpSoundSentryW->iWindowsEffectMSec = 0;
|
|
|
|
lpSoundSentryW->lpszWindowsEffectDLL = 0;
|
|
|
|
lpSoundSentryW->iWindowsEffectOrdinal = 0;
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = TRUE;
|
2001-12-27 00:39:50 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2000-11-05 04:18:47 +01:00
|
|
|
WINE_SPI_FIXME(SPI_SETSOUNDSENTRY); /* 65 */
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-11-05 04:18:47 +01:00
|
|
|
case SPI_GETHIGHCONTRAST: /* 66 WINVER >= 0x400 */
|
|
|
|
{
|
2009-03-02 10:24:30 +01:00
|
|
|
LPHIGHCONTRASTW lpHighContrastW = pvParam;
|
2000-11-05 04:18:47 +01:00
|
|
|
WARN("SPI_GETHIGHCONTRAST not fully implemented\n");
|
2004-03-04 02:41:11 +01:00
|
|
|
if (lpHighContrastW && lpHighContrastW->cbSize == sizeof(HIGHCONTRASTW))
|
2000-11-05 04:18:47 +01:00
|
|
|
{
|
2001-12-27 00:39:50 +01:00
|
|
|
/* Indicate that no high contrast feature available */
|
2004-03-04 02:41:11 +01:00
|
|
|
lpHighContrastW->dwFlags = 0;
|
|
|
|
lpHighContrastW->lpszDefaultScheme = NULL;
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = TRUE;
|
2000-11-05 04:18:47 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
WINE_SPI_FIXME(SPI_SETHIGHCONTRAST); /* 67 WINVER >= 0x400 */
|
|
|
|
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETKEYBOARDPREF:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_KEYBOARDPREF, uiParam, pvParam );
|
2002-01-15 21:43:43 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_SETKEYBOARDPREF:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_KEYBOARDPREF, uiParam, pvParam, fWinIni );
|
2002-01-15 21:43:43 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETSCREENREADER:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_SCREENREADER, uiParam, pvParam );
|
2002-01-15 21:43:43 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_SETSCREENREADER:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_SCREENREADER, uiParam, pvParam, fWinIni );
|
2002-01-15 21:43:43 +01:00
|
|
|
break;
|
2000-11-05 04:18:47 +01:00
|
|
|
|
|
|
|
case SPI_GETANIMATION: /* 72 WINVER >= 0x400 */
|
|
|
|
{
|
2009-03-02 10:24:30 +01:00
|
|
|
LPANIMATIONINFO lpAnimInfo = pvParam;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-11-05 04:18:47 +01:00
|
|
|
/* Tell it "disabled" */
|
2003-08-22 07:00:45 +02:00
|
|
|
if (lpAnimInfo && lpAnimInfo->cbSize == sizeof(ANIMATIONINFO))
|
2012-11-15 17:38:21 +01:00
|
|
|
{
|
2000-11-05 04:18:47 +01:00
|
|
|
lpAnimInfo->iMinAnimate = 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
|
2012-11-15 17:38:21 +01:00
|
|
|
ret = TRUE;
|
|
|
|
}
|
2000-11-05 04:18:47 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
WINE_SPI_WARN(SPI_SETANIMATION); /* 73 WINVER >= 0x400 */
|
|
|
|
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETFONTSMOOTHING:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_FONTSMOOTHING, uiParam, pvParam );
|
|
|
|
if (ret) *(UINT *)pvParam = (*(UINT *)pvParam != 0);
|
2004-02-12 23:40:24 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_SETFONTSMOOTHING:
|
2006-01-27 19:19:19 +01:00
|
|
|
uiParam = uiParam ? 2 : 0; /* Win NT4/2k/XP behavior */
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_FONTSMOOTHING, uiParam, pvParam, fWinIni );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
2012-11-13 15:59:37 +01:00
|
|
|
case SPI_SETDRAGWIDTH:
|
|
|
|
ret = set_entry( &entry_DRAGWIDTH, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
|
|
|
case SPI_SETDRAGHEIGHT:
|
|
|
|
ret = set_entry( &entry_DRAGHEIGHT, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
2000-11-05 04:18:47 +01:00
|
|
|
|
|
|
|
WINE_SPI_FIXME(SPI_SETHANDHELD); /* 78 WINVER >= 0x400 */
|
|
|
|
|
|
|
|
WINE_SPI_FIXME(SPI_GETLOWPOWERTIMEOUT); /* 79 WINVER >= 0x400 */
|
|
|
|
WINE_SPI_FIXME(SPI_GETPOWEROFFTIMEOUT); /* 80 WINVER >= 0x400 */
|
|
|
|
WINE_SPI_FIXME(SPI_SETLOWPOWERTIMEOUT); /* 81 WINVER >= 0x400 */
|
|
|
|
WINE_SPI_FIXME(SPI_SETPOWEROFFTIMEOUT); /* 82 WINVER >= 0x400 */
|
2004-10-14 05:06:41 +02:00
|
|
|
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETLOWPOWERACTIVE:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_LOWPOWERACTIVE, uiParam, pvParam );
|
2005-02-21 21:40:44 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_SETLOWPOWERACTIVE:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_LOWPOWERACTIVE, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
|
|
|
case SPI_GETPOWEROFFACTIVE:
|
|
|
|
ret = get_entry( &entry_POWEROFFACTIVE, uiParam, pvParam );
|
2005-02-21 21:40:44 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_SETPOWEROFFACTIVE:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_POWEROFFACTIVE, uiParam, pvParam, fWinIni );
|
2005-02-21 21:40:44 +01:00
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-11-05 04:18:47 +01:00
|
|
|
WINE_SPI_FIXME(SPI_SETCURSORS); /* 87 WINVER >= 0x400 */
|
|
|
|
WINE_SPI_FIXME(SPI_SETICONS); /* 88 WINVER >= 0x400 */
|
|
|
|
|
2002-08-28 02:54:53 +02:00
|
|
|
case SPI_GETDEFAULTINPUTLANG: /* 89 WINVER >= 0x400 */
|
2012-08-08 10:15:09 +02:00
|
|
|
ret = GetKeyboardLayout(0) != 0;
|
2002-08-28 02:54:53 +02:00
|
|
|
break;
|
|
|
|
|
2000-11-05 04:18:47 +01:00
|
|
|
WINE_SPI_FIXME(SPI_SETDEFAULTINPUTLANG); /* 90 WINVER >= 0x400 */
|
|
|
|
|
|
|
|
WINE_SPI_FIXME(SPI_SETLANGTOGGLE); /* 91 WINVER >= 0x400 */
|
|
|
|
|
|
|
|
case SPI_GETWINDOWSEXTENSION: /* 92 WINVER >= 0x400 */
|
|
|
|
WARN("pretend no support for Win9x Plus! for now.\n");
|
|
|
|
ret = FALSE; /* yes, this is the result value */
|
|
|
|
break;
|
2012-11-13 15:59:37 +01:00
|
|
|
case SPI_SETMOUSETRAILS:
|
|
|
|
ret = set_entry( &entry_MOUSETRAILS, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
|
|
|
case SPI_GETMOUSETRAILS:
|
|
|
|
ret = get_entry( &entry_MOUSETRAILS, uiParam, pvParam );
|
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_GETSNAPTODEFBUTTON:
|
|
|
|
ret = get_entry( &entry_SNAPTODEFBUTTON, uiParam, pvParam );
|
2008-05-27 17:03:44 +02:00
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_SETSNAPTODEFBUTTON:
|
|
|
|
ret = set_entry( &entry_SNAPTODEFBUTTON, uiParam, pvParam, fWinIni );
|
2008-05-27 17:03:44 +02:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_SETSCREENSAVERRUNNING:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_SCREENSAVERRUNNING, uiParam, pvParam, fWinIni );
|
2001-11-20 21:27:26 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETMOUSEHOVERWIDTH:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_MOUSEHOVERWIDTH, uiParam, pvParam );
|
2004-03-19 02:16:12 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_SETMOUSEHOVERWIDTH:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_MOUSEHOVERWIDTH, uiParam, pvParam, fWinIni );
|
2004-03-19 02:16:12 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETMOUSEHOVERHEIGHT:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_MOUSEHOVERHEIGHT, uiParam, pvParam );
|
2004-03-19 02:16:12 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_SETMOUSEHOVERHEIGHT:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_MOUSEHOVERHEIGHT, uiParam, pvParam, fWinIni );
|
2001-04-02 21:12:22 +02:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETMOUSEHOVERTIME:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_MOUSEHOVERTIME, uiParam, pvParam );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETMOUSEHOVERTIME:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_MOUSEHOVERTIME, uiParam, pvParam, fWinIni );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_GETWHEELSCROLLLINES:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_WHEELSCROLLLINES, uiParam, pvParam );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETWHEELSCROLLLINES:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_WHEELSCROLLLINES, uiParam, pvParam, fWinIni );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_GETMENUSHOWDELAY:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_MENUSHOWDELAY, uiParam, pvParam );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETMENUSHOWDELAY:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_MENUSHOWDELAY, uiParam, pvParam, fWinIni );
|
2004-03-19 02:16:12 +01:00
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_GETWHEELSCROLLCHARS:
|
|
|
|
ret = get_entry( &entry_WHEELSCROLLCHARS, uiParam, pvParam );
|
2008-06-23 14:57:32 +02:00
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_SETWHEELSCROLLCHARS:
|
|
|
|
ret = set_entry( &entry_WHEELSCROLLCHARS, uiParam, pvParam, fWinIni );
|
2008-06-23 14:57:32 +02:00
|
|
|
break;
|
|
|
|
|
2000-11-05 04:18:47 +01:00
|
|
|
WINE_SPI_FIXME(SPI_GETSHOWIMEUI); /* 110 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
|
|
|
|
WINE_SPI_FIXME(SPI_SETSHOWIMEUI); /* 111 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
|
2007-10-14 11:59:41 +02:00
|
|
|
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_GETMOUSESPEED:
|
|
|
|
ret = get_entry( &entry_MOUSESPEED, uiParam, pvParam );
|
2007-10-14 11:59:41 +02:00
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_SETMOUSESPEED:
|
|
|
|
ret = set_entry( &entry_MOUSESPEED, uiParam, pvParam, fWinIni );
|
2008-02-07 21:30:47 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETSCREENSAVERRUNNING:
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = get_entry( &entry_SCREENSAVERRUNNING, uiParam, pvParam );
|
2001-11-20 21:27:26 +01:00
|
|
|
break;
|
2012-11-15 15:54:52 +01:00
|
|
|
case SPI_GETDESKWALLPAPER:
|
|
|
|
ret = get_entry( &entry_DESKWALLPAPER, uiParam, pvParam );
|
|
|
|
break;
|
2012-11-13 15:59:37 +01:00
|
|
|
case SPI_GETACTIVEWINDOWTRACKING:
|
|
|
|
ret = get_entry( &entry_ACTIVEWINDOWTRACKING, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_SETACTIVEWINDOWTRACKING:
|
|
|
|
ret = set_entry( &entry_ACTIVEWINDOWTRACKING, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
2012-11-14 12:19:19 +01:00
|
|
|
case SPI_GETMENUANIMATION:
|
|
|
|
ret = get_entry( &entry_MENUANIMATION, uiParam, pvParam );
|
2006-03-29 08:57:34 +02:00
|
|
|
break;
|
2012-11-14 12:19:19 +01:00
|
|
|
case SPI_SETMENUANIMATION:
|
|
|
|
ret = set_entry( &entry_MENUANIMATION, uiParam, pvParam, fWinIni );
|
2006-03-29 08:57:34 +02:00
|
|
|
break;
|
2012-11-14 12:19:19 +01:00
|
|
|
case SPI_GETCOMBOBOXANIMATION:
|
|
|
|
ret = get_entry( &entry_COMBOBOXANIMATION, uiParam, pvParam );
|
2006-03-29 08:56:09 +02:00
|
|
|
break;
|
2012-11-14 12:19:19 +01:00
|
|
|
case SPI_SETCOMBOBOXANIMATION:
|
|
|
|
ret = set_entry( &entry_COMBOBOXANIMATION, uiParam, pvParam, fWinIni );
|
2006-03-29 08:56:09 +02:00
|
|
|
break;
|
2012-11-14 12:19:19 +01:00
|
|
|
case SPI_GETLISTBOXSMOOTHSCROLLING:
|
|
|
|
ret = get_entry( &entry_LISTBOXSMOOTHSCROLLING, uiParam, pvParam );
|
2004-02-12 23:40:24 +01:00
|
|
|
break;
|
2012-11-14 12:19:19 +01:00
|
|
|
case SPI_SETLISTBOXSMOOTHSCROLLING:
|
|
|
|
ret = set_entry( &entry_LISTBOXSMOOTHSCROLLING, uiParam, pvParam, fWinIni );
|
2006-03-29 08:56:55 +02:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETGRADIENTCAPTIONS:
|
2012-11-14 12:19:19 +01:00
|
|
|
ret = get_entry( &entry_GRADIENTCAPTIONS, uiParam, pvParam );
|
2003-03-26 02:23:38 +01:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_SETGRADIENTCAPTIONS:
|
2012-11-14 12:19:19 +01:00
|
|
|
ret = set_entry( &entry_GRADIENTCAPTIONS, uiParam, pvParam, fWinIni );
|
2005-07-07 20:24:35 +02:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETKEYBOARDCUES:
|
2012-11-14 12:19:19 +01:00
|
|
|
ret = get_entry( &entry_KEYBOARDCUES, uiParam, pvParam );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETKEYBOARDCUES:
|
2012-11-14 12:19:19 +01:00
|
|
|
ret = set_entry( &entry_KEYBOARDCUES, uiParam, pvParam, fWinIni );
|
2004-02-12 23:40:24 +01:00
|
|
|
break;
|
2012-11-14 12:54:41 +01:00
|
|
|
case SPI_GETACTIVEWNDTRKZORDER:
|
|
|
|
ret = get_entry( &entry_ACTIVEWNDTRKZORDER, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_SETACTIVEWNDTRKZORDER:
|
|
|
|
ret = set_entry( &entry_ACTIVEWNDTRKZORDER, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETHOTTRACKING:
|
2012-11-14 12:19:19 +01:00
|
|
|
ret = get_entry( &entry_HOTTRACKING, uiParam, pvParam );
|
2005-07-15 18:35:27 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETHOTTRACKING:
|
2012-11-14 12:19:19 +01:00
|
|
|
ret = set_entry( &entry_HOTTRACKING, uiParam, pvParam, fWinIni );
|
2004-02-12 23:40:24 +01:00
|
|
|
break;
|
2012-11-14 12:54:41 +01:00
|
|
|
case SPI_GETMENUFADE:
|
|
|
|
ret = get_entry( &entry_MENUFADE, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_SETMENUFADE:
|
|
|
|
ret = set_entry( &entry_MENUFADE, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
2012-11-14 12:19:19 +01:00
|
|
|
case SPI_GETSELECTIONFADE:
|
|
|
|
ret = get_entry( &entry_SELECTIONFADE, uiParam, pvParam );
|
2006-03-29 08:57:34 +02:00
|
|
|
break;
|
2012-11-14 12:19:19 +01:00
|
|
|
case SPI_SETSELECTIONFADE:
|
|
|
|
ret = set_entry( &entry_SELECTIONFADE, uiParam, pvParam, fWinIni );
|
2006-03-29 08:57:34 +02:00
|
|
|
break;
|
2012-11-14 12:19:19 +01:00
|
|
|
case SPI_GETTOOLTIPANIMATION:
|
|
|
|
ret = get_entry( &entry_TOOLTIPANIMATION, uiParam, pvParam );
|
2006-03-29 08:58:06 +02:00
|
|
|
break;
|
2012-11-14 12:19:19 +01:00
|
|
|
case SPI_SETTOOLTIPANIMATION:
|
|
|
|
ret = set_entry( &entry_TOOLTIPANIMATION, uiParam, pvParam, fWinIni );
|
2006-03-29 08:58:06 +02:00
|
|
|
break;
|
2012-11-14 12:19:19 +01:00
|
|
|
case SPI_GETTOOLTIPFADE:
|
|
|
|
ret = get_entry( &entry_TOOLTIPFADE, uiParam, pvParam );
|
2006-03-29 08:58:06 +02:00
|
|
|
break;
|
2012-11-14 12:19:19 +01:00
|
|
|
case SPI_SETTOOLTIPFADE:
|
|
|
|
ret = set_entry( &entry_TOOLTIPFADE, uiParam, pvParam, fWinIni );
|
2006-03-29 08:58:06 +02:00
|
|
|
break;
|
2012-11-14 12:19:19 +01:00
|
|
|
case SPI_GETCURSORSHADOW:
|
|
|
|
ret = get_entry( &entry_CURSORSHADOW, uiParam, pvParam );
|
2006-03-29 08:56:30 +02:00
|
|
|
break;
|
2012-11-14 12:19:19 +01:00
|
|
|
case SPI_SETCURSORSHADOW:
|
|
|
|
ret = set_entry( &entry_CURSORSHADOW, uiParam, pvParam, fWinIni );
|
2006-03-29 08:56:30 +02:00
|
|
|
break;
|
2012-11-14 12:54:41 +01:00
|
|
|
case SPI_GETMOUSESONAR:
|
|
|
|
ret = get_entry( &entry_MOUSESONAR, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_SETMOUSESONAR:
|
|
|
|
ret = set_entry( &entry_MOUSESONAR, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
|
|
|
case SPI_GETMOUSECLICKLOCK:
|
|
|
|
ret = get_entry( &entry_MOUSECLICKLOCK, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_SETMOUSECLICKLOCK:
|
|
|
|
ret = set_entry( &entry_MOUSECLICKLOCK, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
2009-09-27 19:28:23 +02:00
|
|
|
case SPI_GETMOUSEVANISH:
|
2012-11-14 12:19:19 +01:00
|
|
|
ret = get_entry( &entry_MOUSEVANISH, uiParam, pvParam );
|
2009-09-27 19:28:23 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETMOUSEVANISH:
|
2012-11-14 12:19:19 +01:00
|
|
|
ret = set_entry( &entry_MOUSEVANISH, uiParam, pvParam, fWinIni );
|
2009-09-27 19:28:23 +02:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_GETFLATMENU:
|
2012-11-14 12:19:19 +01:00
|
|
|
ret = get_entry( &entry_FLATMENU, uiParam, pvParam );
|
2005-07-05 12:55:44 +02:00
|
|
|
break;
|
2005-07-15 18:35:27 +02:00
|
|
|
case SPI_SETFLATMENU:
|
2012-11-14 12:19:19 +01:00
|
|
|
ret = set_entry( &entry_FLATMENU, uiParam, pvParam, fWinIni );
|
2005-07-05 12:55:44 +02:00
|
|
|
break;
|
2009-09-27 17:50:29 +02:00
|
|
|
case SPI_GETDROPSHADOW:
|
2012-11-14 12:19:19 +01:00
|
|
|
ret = get_entry( &entry_DROPSHADOW, uiParam, pvParam );
|
2009-09-27 17:50:29 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETDROPSHADOW:
|
2012-11-14 12:19:19 +01:00
|
|
|
ret = set_entry( &entry_DROPSHADOW, uiParam, pvParam, fWinIni );
|
2009-09-27 17:50:29 +02:00
|
|
|
break;
|
2012-11-13 15:59:37 +01:00
|
|
|
case SPI_GETBLOCKSENDINPUTRESETS:
|
|
|
|
ret = get_entry( &entry_BLOCKSENDINPUTRESETS, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_SETBLOCKSENDINPUTRESETS:
|
|
|
|
ret = set_entry( &entry_BLOCKSENDINPUTRESETS, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
2006-03-29 08:58:26 +02:00
|
|
|
case SPI_GETUIEFFECTS:
|
2012-11-14 12:19:19 +01:00
|
|
|
ret = get_entry( &entry_UIEFFECTS, uiParam, pvParam );
|
2006-03-29 08:58:26 +02:00
|
|
|
break;
|
|
|
|
case SPI_SETUIEFFECTS:
|
|
|
|
/* FIXME: this probably should mask other UI effect values when unset */
|
2012-11-14 12:19:19 +01:00
|
|
|
ret = set_entry( &entry_UIEFFECTS, uiParam, pvParam, fWinIni );
|
2006-03-29 08:58:26 +02:00
|
|
|
break;
|
2012-11-14 12:54:41 +01:00
|
|
|
case SPI_GETDISABLEOVERLAPPEDCONTENT:
|
|
|
|
ret = get_entry( &entry_DISABLEOVERLAPPEDCONTENT, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_SETDISABLEOVERLAPPEDCONTENT:
|
|
|
|
ret = set_entry( &entry_DISABLEOVERLAPPEDCONTENT, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
|
|
|
case SPI_GETCLIENTAREAANIMATION:
|
|
|
|
ret = get_entry( &entry_CLIENTAREAANIMATION, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_SETCLIENTAREAANIMATION:
|
|
|
|
ret = set_entry( &entry_CLIENTAREAANIMATION, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
|
|
|
case SPI_GETCLEARTYPE:
|
|
|
|
ret = get_entry( &entry_CLEARTYPE, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_SETCLEARTYPE:
|
|
|
|
ret = set_entry( &entry_CLEARTYPE, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
|
|
|
case SPI_GETSPEECHRECOGNITION:
|
|
|
|
ret = get_entry( &entry_SPEECHRECOGNITION, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_SETSPEECHRECOGNITION:
|
|
|
|
ret = set_entry( &entry_SPEECHRECOGNITION, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_GETFOREGROUNDLOCKTIMEOUT:
|
|
|
|
ret = get_entry( &entry_FOREGROUNDLOCKTIMEOUT, uiParam, pvParam );
|
2008-11-06 15:03:43 +01:00
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_SETFOREGROUNDLOCKTIMEOUT:
|
2008-11-06 15:03:43 +01:00
|
|
|
/* FIXME: this should check that the calling thread
|
|
|
|
* is able to change the foreground window */
|
2012-11-13 15:10:05 +01:00
|
|
|
ret = set_entry( &entry_FOREGROUNDLOCKTIMEOUT, uiParam, pvParam, fWinIni );
|
2008-11-06 15:03:43 +01:00
|
|
|
break;
|
2012-11-13 15:59:37 +01:00
|
|
|
case SPI_GETACTIVEWNDTRKTIMEOUT:
|
|
|
|
ret = get_entry( &entry_ACTIVEWNDTRKTIMEOUT, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_SETACTIVEWNDTRKTIMEOUT:
|
|
|
|
ret = get_entry( &entry_ACTIVEWNDTRKTIMEOUT, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_GETFOREGROUNDFLASHCOUNT:
|
|
|
|
ret = get_entry( &entry_FOREGROUNDFLASHCOUNT, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_SETFOREGROUNDFLASHCOUNT:
|
|
|
|
ret = set_entry( &entry_FOREGROUNDFLASHCOUNT, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_GETCARETWIDTH:
|
|
|
|
ret = get_entry( &entry_CARETWIDTH, uiParam, pvParam );
|
2006-03-29 08:55:39 +02:00
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_SETCARETWIDTH:
|
|
|
|
ret = set_entry( &entry_CARETWIDTH, uiParam, pvParam, fWinIni );
|
2006-03-29 08:55:39 +02:00
|
|
|
break;
|
2012-11-13 15:59:37 +01:00
|
|
|
case SPI_GETMOUSECLICKLOCKTIME:
|
|
|
|
ret = get_entry( &entry_MOUSECLICKLOCKTIME, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_SETMOUSECLICKLOCKTIME:
|
|
|
|
ret = set_entry( &entry_MOUSECLICKLOCKTIME, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_GETFONTSMOOTHINGTYPE:
|
|
|
|
ret = get_entry( &entry_FONTSMOOTHINGTYPE, uiParam, pvParam );
|
2008-12-27 09:56:49 +01:00
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_SETFONTSMOOTHINGTYPE:
|
|
|
|
ret = set_entry( &entry_FONTSMOOTHINGTYPE, uiParam, pvParam, fWinIni );
|
2008-12-27 09:56:49 +01:00
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_GETFONTSMOOTHINGCONTRAST:
|
|
|
|
ret = get_entry( &entry_FONTSMOOTHINGCONTRAST, uiParam, pvParam );
|
2008-12-27 09:56:49 +01:00
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_SETFONTSMOOTHINGCONTRAST:
|
|
|
|
ret = set_entry( &entry_FONTSMOOTHINGCONTRAST, uiParam, pvParam, fWinIni );
|
2008-12-27 09:56:49 +01:00
|
|
|
break;
|
2012-11-13 15:59:37 +01:00
|
|
|
case SPI_GETFOCUSBORDERWIDTH:
|
|
|
|
ret = get_entry( &entry_FOCUSBORDERWIDTH, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_GETFOCUSBORDERHEIGHT:
|
|
|
|
ret = get_entry( &entry_FOCUSBORDERHEIGHT, uiParam, pvParam );
|
|
|
|
break;
|
|
|
|
case SPI_SETFOCUSBORDERWIDTH:
|
|
|
|
ret = set_entry( &entry_FOCUSBORDERWIDTH, uiParam, pvParam, fWinIni );
|
|
|
|
break;
|
|
|
|
case SPI_SETFOCUSBORDERHEIGHT:
|
|
|
|
ret = set_entry( &entry_FOCUSBORDERHEIGHT, uiParam, pvParam, fWinIni );
|
2009-06-11 14:48:58 +02:00
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_GETFONTSMOOTHINGORIENTATION:
|
|
|
|
ret = get_entry( &entry_FONTSMOOTHINGORIENTATION, uiParam, pvParam );
|
2008-12-27 09:56:49 +01:00
|
|
|
break;
|
2012-11-13 15:10:05 +01:00
|
|
|
case SPI_SETFONTSMOOTHINGORIENTATION:
|
|
|
|
ret = set_entry( &entry_FONTSMOOTHINGORIENTATION, uiParam, pvParam, fWinIni );
|
2008-12-27 09:56:49 +01:00
|
|
|
break;
|
2002-03-11 02:11:41 +01:00
|
|
|
|
2000-11-05 04:18:47 +01:00
|
|
|
default:
|
|
|
|
FIXME( "Unknown action: %u\n", uiAction );
|
|
|
|
SetLastError( ERROR_INVALID_SPI_VALUE );
|
|
|
|
ret = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2001-11-07 21:24:29 +01:00
|
|
|
if (ret)
|
|
|
|
SYSPARAMS_NotifyChange( uiAction, fWinIni );
|
2005-12-16 12:38:06 +01:00
|
|
|
TRACE("(%u, %u, %p, %u) ret %d\n",
|
|
|
|
uiAction, uiParam, pvParam, fWinIni, ret);
|
2000-11-05 04:18:47 +01:00
|
|
|
return ret;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-11-05 04:18:47 +01:00
|
|
|
#undef WINE_SPI_FIXME
|
|
|
|
#undef WINE_SPI_WARN
|
2000-03-18 23:12:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2004-03-04 02:41:11 +01:00
|
|
|
* SystemParametersInfoA (USER32.@)
|
2000-03-18 23:12:33 +01:00
|
|
|
*/
|
2004-03-04 02:41:11 +01:00
|
|
|
BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam,
|
2000-11-05 04:18:47 +01:00
|
|
|
PVOID pvParam, UINT fuWinIni )
|
2000-03-18 23:12:33 +01:00
|
|
|
{
|
2000-11-05 04:18:47 +01:00
|
|
|
BOOL ret;
|
2000-03-18 23:12:33 +01:00
|
|
|
|
2000-11-05 04:18:47 +01:00
|
|
|
TRACE("(%u, %u, %p, %u)\n", uiAction, uiParam, pvParam, fuWinIni);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-11-05 04:18:47 +01:00
|
|
|
switch (uiAction)
|
2000-03-18 23:12:33 +01:00
|
|
|
{
|
2000-11-05 04:18:47 +01:00
|
|
|
case SPI_SETDESKWALLPAPER: /* 20 */
|
|
|
|
case SPI_SETDESKPATTERN: /* 21 */
|
|
|
|
{
|
2004-03-04 02:41:11 +01:00
|
|
|
WCHAR buffer[256];
|
2000-11-05 04:18:47 +01:00
|
|
|
if (pvParam)
|
2009-03-02 10:24:30 +01:00
|
|
|
if (!MultiByteToWideChar( CP_ACP, 0, pvParam, -1, buffer,
|
|
|
|
sizeof(buffer)/sizeof(WCHAR) ))
|
2004-03-04 02:41:11 +01:00
|
|
|
buffer[sizeof(buffer)/sizeof(WCHAR)-1] = 0;
|
|
|
|
ret = SystemParametersInfoW( uiAction, uiParam, pvParam ? buffer : NULL, fuWinIni );
|
2000-11-05 04:18:47 +01:00
|
|
|
break;
|
|
|
|
}
|
2000-03-18 23:12:33 +01:00
|
|
|
|
2000-11-05 04:18:47 +01:00
|
|
|
case SPI_GETICONTITLELOGFONT: /* 31 */
|
|
|
|
{
|
2004-03-04 02:41:11 +01:00
|
|
|
LOGFONTW tmp;
|
|
|
|
ret = SystemParametersInfoW( uiAction, uiParam, pvParam ? &tmp : NULL, fuWinIni );
|
2000-11-05 04:18:47 +01:00
|
|
|
if (ret && pvParam)
|
2009-03-02 10:24:30 +01:00
|
|
|
SYSPARAMS_LogFont32WTo32A( &tmp, pvParam );
|
2000-03-18 23:12:33 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-11-05 04:18:47 +01:00
|
|
|
case SPI_GETNONCLIENTMETRICS: /* 41 WINVER >= 0x400 */
|
2000-03-18 23:12:33 +01:00
|
|
|
{
|
2004-03-04 02:41:11 +01:00
|
|
|
NONCLIENTMETRICSW tmp;
|
2009-03-02 10:24:30 +01:00
|
|
|
LPNONCLIENTMETRICSA lpnmA = pvParam;
|
2011-10-08 13:11:34 +02:00
|
|
|
if (lpnmA && (lpnmA->cbSize == sizeof(NONCLIENTMETRICSA) ||
|
|
|
|
lpnmA->cbSize == FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth)))
|
2000-11-05 04:18:47 +01:00
|
|
|
{
|
2004-03-04 02:41:11 +01:00
|
|
|
tmp.cbSize = sizeof(NONCLIENTMETRICSW);
|
|
|
|
ret = SystemParametersInfoW( uiAction, uiParam, &tmp, fuWinIni );
|
2000-11-05 04:18:47 +01:00
|
|
|
if (ret)
|
2004-03-04 02:41:11 +01:00
|
|
|
SYSPARAMS_NonClientMetrics32WTo32A( &tmp, lpnmA );
|
2000-11-05 04:18:47 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
ret = FALSE;
|
|
|
|
break;
|
2000-03-18 23:12:33 +01:00
|
|
|
}
|
|
|
|
|
2005-11-07 17:39:21 +01:00
|
|
|
case SPI_SETNONCLIENTMETRICS: /* 42 WINVER >= 0x400 */
|
|
|
|
{
|
|
|
|
NONCLIENTMETRICSW tmp;
|
2009-03-02 10:24:30 +01:00
|
|
|
LPNONCLIENTMETRICSA lpnmA = pvParam;
|
2011-10-08 13:11:34 +02:00
|
|
|
if (lpnmA && (lpnmA->cbSize == sizeof(NONCLIENTMETRICSA) ||
|
|
|
|
lpnmA->cbSize == FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth)))
|
2005-11-07 17:39:21 +01:00
|
|
|
{
|
|
|
|
tmp.cbSize = sizeof(NONCLIENTMETRICSW);
|
|
|
|
SYSPARAMS_NonClientMetrics32ATo32W( lpnmA, &tmp );
|
|
|
|
ret = SystemParametersInfoW( uiAction, uiParam, &tmp, fuWinIni );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ret = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-11-05 04:18:47 +01:00
|
|
|
case SPI_GETICONMETRICS: /* 45 WINVER >= 0x400 */
|
|
|
|
{
|
2004-03-04 02:41:11 +01:00
|
|
|
ICONMETRICSW tmp;
|
2009-03-02 10:24:30 +01:00
|
|
|
LPICONMETRICSA lpimA = pvParam;
|
2005-01-20 21:43:02 +01:00
|
|
|
if (lpimA && lpimA->cbSize == sizeof(ICONMETRICSA))
|
|
|
|
{
|
|
|
|
tmp.cbSize = sizeof(ICONMETRICSW);
|
|
|
|
ret = SystemParametersInfoW( uiAction, uiParam, &tmp, fuWinIni );
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
lpimA->iHorzSpacing = tmp.iHorzSpacing;
|
|
|
|
lpimA->iVertSpacing = tmp.iVertSpacing;
|
|
|
|
lpimA->iTitleWrap = tmp.iTitleWrap;
|
|
|
|
SYSPARAMS_LogFont32WTo32A( &tmp.lfFont, &lpimA->lfFont );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ret = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case SPI_SETICONMETRICS: /* 46 WINVER >= 0x400 */
|
|
|
|
{
|
2005-11-14 16:12:14 +01:00
|
|
|
ICONMETRICSW tmp;
|
2009-03-02 10:24:30 +01:00
|
|
|
LPICONMETRICSA lpimA = pvParam;
|
2005-11-14 16:12:14 +01:00
|
|
|
if (lpimA && lpimA->cbSize == sizeof(ICONMETRICSA))
|
|
|
|
{
|
|
|
|
tmp.cbSize = sizeof(ICONMETRICSW);
|
|
|
|
tmp.iHorzSpacing = lpimA->iHorzSpacing;
|
|
|
|
tmp.iVertSpacing = lpimA->iVertSpacing;
|
|
|
|
tmp.iTitleWrap = lpimA->iTitleWrap;
|
|
|
|
SYSPARAMS_LogFont32ATo32W( &lpimA->lfFont, &tmp.lfFont);
|
|
|
|
ret = SystemParametersInfoW( uiAction, uiParam, &tmp, fuWinIni );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ret = FALSE;
|
|
|
|
break;
|
2000-11-05 04:18:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
case SPI_GETHIGHCONTRAST: /* 66 WINVER >= 0x400 */
|
|
|
|
{
|
2004-03-04 02:41:11 +01:00
|
|
|
HIGHCONTRASTW tmp;
|
2009-03-02 10:24:30 +01:00
|
|
|
LPHIGHCONTRASTA lphcA = pvParam;
|
2004-03-04 02:41:11 +01:00
|
|
|
if (lphcA && lphcA->cbSize == sizeof(HIGHCONTRASTA))
|
2000-11-05 04:18:47 +01:00
|
|
|
{
|
2004-03-04 02:41:11 +01:00
|
|
|
tmp.cbSize = sizeof(HIGHCONTRASTW);
|
|
|
|
ret = SystemParametersInfoW( uiAction, uiParam, &tmp, fuWinIni );
|
2000-11-05 04:18:47 +01:00
|
|
|
if (ret)
|
|
|
|
{
|
2004-03-04 02:41:11 +01:00
|
|
|
lphcA->dwFlags = tmp.dwFlags;
|
|
|
|
lphcA->lpszDefaultScheme = NULL; /* FIXME? */
|
2000-11-05 04:18:47 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ret = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2006-07-12 04:22:38 +02:00
|
|
|
case SPI_GETDESKWALLPAPER: /* 115 */
|
|
|
|
{
|
|
|
|
WCHAR buffer[MAX_PATH];
|
|
|
|
ret = (SystemParametersInfoW( SPI_GETDESKWALLPAPER, uiParam, buffer, fuWinIni ) &&
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, buffer, -1, pvParam, uiParam, NULL, NULL));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-03-18 23:12:33 +01:00
|
|
|
default:
|
2004-03-04 02:41:11 +01:00
|
|
|
ret = SystemParametersInfoW( uiAction, uiParam, pvParam, fuWinIni );
|
2001-11-07 21:24:29 +01:00
|
|
|
break;
|
2000-03-18 23:12:33 +01:00
|
|
|
}
|
2000-11-05 04:18:47 +01:00
|
|
|
return ret;
|
2000-03-18 23:12:33 +01:00
|
|
|
}
|
2001-12-06 23:28:43 +01:00
|
|
|
|
|
|
|
|
2004-12-09 14:48:56 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* GetSystemMetrics (USER32.@)
|
|
|
|
*/
|
|
|
|
INT WINAPI GetSystemMetrics( INT index )
|
|
|
|
{
|
2012-11-15 13:28:54 +01:00
|
|
|
NONCLIENTMETRICSW ncm;
|
2005-07-18 11:20:07 +02:00
|
|
|
UINT ret;
|
|
|
|
|
2004-12-09 14:48:56 +01:00
|
|
|
/* some metrics are dynamic */
|
|
|
|
switch (index)
|
|
|
|
{
|
|
|
|
case SM_CXSCREEN:
|
2005-07-18 11:20:07 +02:00
|
|
|
return GetDeviceCaps( get_display_dc(), HORZRES );
|
2004-12-09 14:48:56 +01:00
|
|
|
case SM_CYSCREEN:
|
2005-07-18 11:20:07 +02:00
|
|
|
return GetDeviceCaps( get_display_dc(), VERTRES );
|
|
|
|
case SM_CXVSCROLL:
|
|
|
|
case SM_CYHSCROLL:
|
2012-11-15 13:28:54 +01:00
|
|
|
get_entry( &entry_SCROLLWIDTH, 0, &ret );
|
|
|
|
return max( 8, ret );
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CYCAPTION:
|
2012-11-15 13:28:54 +01:00
|
|
|
return GetSystemMetrics( SM_CYSIZE ) + 1;
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CXBORDER:
|
|
|
|
case SM_CYBORDER:
|
|
|
|
/* SM_C{X,Y}BORDER always returns 1 regardless of 'BorderWidth' value in registry */
|
|
|
|
return 1;
|
|
|
|
case SM_CXDLGFRAME:
|
|
|
|
case SM_CYDLGFRAME:
|
|
|
|
return 3;
|
|
|
|
case SM_CYVTHUMB:
|
|
|
|
case SM_CXHTHUMB:
|
2012-11-15 13:28:54 +01:00
|
|
|
case SM_CYVSCROLL:
|
|
|
|
case SM_CXHSCROLL:
|
|
|
|
get_entry( &entry_SCROLLHEIGHT, 0, &ret );
|
|
|
|
return max( 8, ret );
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CXICON:
|
|
|
|
case SM_CYICON:
|
2012-11-15 13:28:54 +01:00
|
|
|
get_entry( &entry_ICONSIZE, 0, &ret );
|
|
|
|
return ret;
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CXCURSOR:
|
|
|
|
case SM_CYCURSOR:
|
|
|
|
return 32;
|
|
|
|
case SM_CYMENU:
|
|
|
|
return GetSystemMetrics(SM_CYMENUSIZE) + 1;
|
|
|
|
case SM_CXFULLSCREEN:
|
2005-11-22 15:56:11 +01:00
|
|
|
/* see the remark for SM_CXMAXIMIZED, at least this formulation is
|
|
|
|
* correct */
|
|
|
|
return GetSystemMetrics( SM_CXMAXIMIZED) - 2 * GetSystemMetrics( SM_CXFRAME);
|
2004-12-09 14:48:56 +01:00
|
|
|
case SM_CYFULLSCREEN:
|
2005-11-22 15:56:11 +01:00
|
|
|
/* see the remark for SM_CYMAXIMIZED, at least this formulation is
|
|
|
|
* correct */
|
|
|
|
return GetSystemMetrics( SM_CYMAXIMIZED) - GetSystemMetrics( SM_CYMIN);
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CYKANJIWINDOW:
|
|
|
|
return 0;
|
|
|
|
case SM_MOUSEPRESENT:
|
|
|
|
return 1;
|
|
|
|
case SM_DEBUG:
|
|
|
|
return 0;
|
|
|
|
case SM_SWAPBUTTON:
|
2012-11-13 15:10:05 +01:00
|
|
|
get_entry( &entry_MOUSEBUTTONSWAP, 0, &ret );
|
2005-07-18 11:20:07 +02:00
|
|
|
return ret;
|
|
|
|
case SM_RESERVED1:
|
|
|
|
case SM_RESERVED2:
|
|
|
|
case SM_RESERVED3:
|
|
|
|
case SM_RESERVED4:
|
|
|
|
return 0;
|
|
|
|
case SM_CXMIN:
|
2013-01-03 11:45:02 +01:00
|
|
|
ncm.cbSize = sizeof(ncm);
|
2012-11-15 13:28:54 +01:00
|
|
|
SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 );
|
|
|
|
get_text_metr_size( get_display_dc(), &ncm.lfCaptionFont, NULL, &ret );
|
|
|
|
return 3 * ncm.iCaptionWidth + ncm.iCaptionHeight + 4 * ret + 2 * GetSystemMetrics(SM_CXFRAME) + 4;
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CYMIN:
|
2005-11-22 15:56:11 +01:00
|
|
|
return GetSystemMetrics( SM_CYCAPTION) + 2 * GetSystemMetrics( SM_CYFRAME);
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CXSIZE:
|
2012-11-15 13:28:54 +01:00
|
|
|
get_entry( &entry_CAPTIONWIDTH, 0, &ret );
|
|
|
|
return max( 8, ret );
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CYSIZE:
|
2013-01-03 11:45:02 +01:00
|
|
|
ncm.cbSize = sizeof(ncm);
|
2012-11-15 13:28:54 +01:00
|
|
|
SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 );
|
|
|
|
return ncm.iCaptionHeight;
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CXFRAME:
|
2012-11-15 13:28:54 +01:00
|
|
|
get_entry( &entry_BORDER, 0, &ret );
|
|
|
|
return GetSystemMetrics(SM_CXDLGFRAME) + max( 1, ret );
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CYFRAME:
|
2012-11-15 13:28:54 +01:00
|
|
|
get_entry( &entry_BORDER, 0, &ret );
|
|
|
|
return GetSystemMetrics(SM_CYDLGFRAME) + max( 1, ret );
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CXMINTRACK:
|
|
|
|
return GetSystemMetrics(SM_CXMIN);
|
|
|
|
case SM_CYMINTRACK:
|
|
|
|
return GetSystemMetrics(SM_CYMIN);
|
|
|
|
case SM_CXDOUBLECLK:
|
2012-11-13 15:10:05 +01:00
|
|
|
get_entry( &entry_DOUBLECLKWIDTH, 0, &ret );
|
2005-07-18 11:20:07 +02:00
|
|
|
return ret;
|
|
|
|
case SM_CYDOUBLECLK:
|
2012-11-13 15:10:05 +01:00
|
|
|
get_entry( &entry_DOUBLECLKHEIGHT, 0, &ret );
|
2005-07-18 11:20:07 +02:00
|
|
|
return ret;
|
|
|
|
case SM_CXICONSPACING:
|
2012-11-13 15:10:05 +01:00
|
|
|
get_entry( &entry_ICONHORIZONTALSPACING, 0, &ret );
|
2005-07-18 11:20:07 +02:00
|
|
|
return ret;
|
|
|
|
case SM_CYICONSPACING:
|
2012-11-13 15:10:05 +01:00
|
|
|
get_entry( &entry_ICONVERTICALSPACING, 0, &ret );
|
2005-07-18 11:20:07 +02:00
|
|
|
return ret;
|
|
|
|
case SM_MENUDROPALIGNMENT:
|
2012-11-13 15:10:05 +01:00
|
|
|
get_entry( &entry_MENUDROPALIGNMENT, 0, &ret );
|
2005-07-18 11:20:07 +02:00
|
|
|
return ret;
|
|
|
|
case SM_PENWINDOWS:
|
|
|
|
return 0;
|
|
|
|
case SM_DBCSENABLED:
|
|
|
|
{
|
|
|
|
CPINFO cpinfo;
|
|
|
|
GetCPInfo( CP_ACP, &cpinfo );
|
|
|
|
return (cpinfo.MaxCharSize > 1);
|
|
|
|
}
|
|
|
|
case SM_CMOUSEBUTTONS:
|
|
|
|
return 3;
|
|
|
|
case SM_SECURE:
|
|
|
|
return 0;
|
|
|
|
case SM_CXEDGE:
|
|
|
|
return GetSystemMetrics(SM_CXBORDER) + 1;
|
|
|
|
case SM_CYEDGE:
|
|
|
|
return GetSystemMetrics(SM_CYBORDER) + 1;
|
|
|
|
case SM_CXMINSPACING:
|
2012-11-15 13:28:54 +01:00
|
|
|
get_entry( &entry_MINHORZGAP, 0, &ret );
|
2012-11-13 15:10:05 +01:00
|
|
|
return GetSystemMetrics(SM_CXMINIMIZED) + max( 0, (INT)ret );
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CYMINSPACING:
|
2012-11-15 13:28:54 +01:00
|
|
|
get_entry( &entry_MINVERTGAP, 0, &ret );
|
2012-11-13 15:10:05 +01:00
|
|
|
return GetSystemMetrics(SM_CYMINIMIZED) + max( 0, (INT)ret );
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CXSMICON:
|
|
|
|
case SM_CYSMICON:
|
|
|
|
return 16;
|
|
|
|
case SM_CYSMCAPTION:
|
|
|
|
return GetSystemMetrics(SM_CYSMSIZE) + 1;
|
|
|
|
case SM_CXSMSIZE:
|
2012-11-15 13:28:54 +01:00
|
|
|
get_entry( &entry_SMCAPTIONWIDTH, 0, &ret );
|
|
|
|
return ret;
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CYSMSIZE:
|
2013-01-03 11:45:02 +01:00
|
|
|
ncm.cbSize = sizeof(ncm);
|
2012-11-15 13:28:54 +01:00
|
|
|
SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 );
|
|
|
|
return ncm.iSmCaptionHeight;
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CXMENUSIZE:
|
2012-11-15 13:28:54 +01:00
|
|
|
get_entry( &entry_MENUWIDTH, 0, &ret );
|
|
|
|
return ret;
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CYMENUSIZE:
|
2013-01-03 11:45:02 +01:00
|
|
|
ncm.cbSize = sizeof(ncm);
|
2012-11-15 13:28:54 +01:00
|
|
|
SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 );
|
|
|
|
return ncm.iMenuHeight;
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_ARRANGE:
|
2012-11-15 13:28:54 +01:00
|
|
|
get_entry( &entry_MINARRANGE, 0, &ret );
|
2012-11-13 15:10:05 +01:00
|
|
|
return ret & 0x0f;
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CXMINIMIZED:
|
2012-11-15 13:28:54 +01:00
|
|
|
get_entry( &entry_MINWIDTH, 0, &ret );
|
2012-11-13 15:10:05 +01:00
|
|
|
return max( 0, (INT)ret ) + 6;
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CYMINIMIZED:
|
2012-11-15 13:28:54 +01:00
|
|
|
return GetSystemMetrics( SM_CYSIZE ) + 6;
|
2004-12-09 14:48:56 +01:00
|
|
|
case SM_CXMAXTRACK:
|
2006-10-23 14:29:57 +02:00
|
|
|
return GetSystemMetrics(SM_CXVIRTUALSCREEN) + 4 + 2 * GetSystemMetrics(SM_CXFRAME);
|
2004-12-09 14:48:56 +01:00
|
|
|
case SM_CYMAXTRACK:
|
2006-10-23 14:29:57 +02:00
|
|
|
return GetSystemMetrics(SM_CYVIRTUALSCREEN) + 4 + 2 * GetSystemMetrics(SM_CYFRAME);
|
2004-12-09 14:48:56 +01:00
|
|
|
case SM_CXMAXIMIZED:
|
2005-11-22 15:56:11 +01:00
|
|
|
/* FIXME: subtract the width of any vertical application toolbars*/
|
2005-07-18 11:20:07 +02:00
|
|
|
return GetSystemMetrics(SM_CXSCREEN) + 2 * GetSystemMetrics(SM_CXFRAME);
|
2004-12-09 14:48:56 +01:00
|
|
|
case SM_CYMAXIMIZED:
|
2005-11-22 15:56:11 +01:00
|
|
|
/* FIXME: subtract the width of any horizontal application toolbars*/
|
|
|
|
return GetSystemMetrics(SM_CYSCREEN) + 2 * GetSystemMetrics(SM_CYCAPTION);
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_NETWORK:
|
|
|
|
return 3; /* FIXME */
|
|
|
|
case SM_CLEANBOOT:
|
|
|
|
return 0; /* 0 = ok, 1 = failsafe, 2 = failsafe + network */
|
|
|
|
case SM_CXDRAG:
|
2012-11-13 15:59:37 +01:00
|
|
|
get_entry( &entry_DRAGWIDTH, 0, &ret );
|
|
|
|
return ret;
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CYDRAG:
|
2012-11-13 15:59:37 +01:00
|
|
|
get_entry( &entry_DRAGHEIGHT, 0, &ret );
|
|
|
|
return ret;
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_SHOWSOUNDS:
|
2012-11-13 15:10:05 +01:00
|
|
|
get_entry( &entry_SHOWSOUNDS, 0, &ret );
|
2005-07-18 11:20:07 +02:00
|
|
|
return ret;
|
|
|
|
case SM_CXMENUCHECK:
|
|
|
|
case SM_CYMENUCHECK:
|
2012-11-15 13:28:54 +01:00
|
|
|
{
|
|
|
|
TEXTMETRICW tm;
|
2013-01-03 11:45:02 +01:00
|
|
|
ncm.cbSize = sizeof(ncm);
|
2012-11-15 13:28:54 +01:00
|
|
|
SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 );
|
|
|
|
get_text_metr_size( get_display_dc(), &ncm.lfMenuFont, &tm, NULL);
|
|
|
|
return tm.tmHeight <= 0 ? 13 : ((tm.tmHeight + tm.tmExternalLeading + 1) / 2) * 2 - 1;
|
|
|
|
}
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_SLOWMACHINE:
|
2007-03-13 05:10:41 +01:00
|
|
|
return 0; /* Never true */
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_MIDEASTENABLED:
|
|
|
|
return 0; /* FIXME */
|
|
|
|
case SM_MOUSEWHEELPRESENT:
|
|
|
|
return 1;
|
|
|
|
case SM_XVIRTUALSCREEN:
|
2006-10-23 14:29:57 +02:00
|
|
|
{
|
2012-09-05 19:28:50 +02:00
|
|
|
RECT rect = get_virtual_screen_rect();
|
|
|
|
return rect.left;
|
2006-10-23 14:29:57 +02:00
|
|
|
}
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_YVIRTUALSCREEN:
|
2006-10-23 14:29:57 +02:00
|
|
|
{
|
2012-09-05 19:28:50 +02:00
|
|
|
RECT rect = get_virtual_screen_rect();
|
|
|
|
return rect.top;
|
2006-10-23 14:29:57 +02:00
|
|
|
}
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CXVIRTUALSCREEN:
|
2006-10-23 14:29:57 +02:00
|
|
|
{
|
2012-09-05 19:28:50 +02:00
|
|
|
RECT rect = get_virtual_screen_rect();
|
|
|
|
return rect.right - rect.left;
|
2006-10-23 14:29:57 +02:00
|
|
|
}
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CYVIRTUALSCREEN:
|
2006-10-23 14:29:57 +02:00
|
|
|
{
|
2012-09-05 19:28:50 +02:00
|
|
|
RECT rect = get_virtual_screen_rect();
|
|
|
|
return rect.bottom - rect.top;
|
2006-10-23 14:29:57 +02:00
|
|
|
}
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_CMONITORS:
|
2006-10-23 14:29:57 +02:00
|
|
|
{
|
|
|
|
struct monitor_info info;
|
|
|
|
get_monitors_info( &info );
|
|
|
|
return info.count;
|
|
|
|
}
|
2005-07-18 11:20:07 +02:00
|
|
|
case SM_SAMEDISPLAYFORMAT:
|
|
|
|
return 1;
|
|
|
|
case SM_IMMENABLED:
|
|
|
|
return 0; /* FIXME */
|
|
|
|
case SM_CXFOCUSBORDER:
|
|
|
|
case SM_CYFOCUSBORDER:
|
|
|
|
return 1;
|
|
|
|
case SM_TABLETPC:
|
|
|
|
case SM_MEDIACENTER:
|
|
|
|
return 0;
|
|
|
|
case SM_CMETRICS:
|
|
|
|
return SM_CMETRICS;
|
2004-12-09 14:48:56 +01:00
|
|
|
default:
|
2005-07-18 11:20:07 +02:00
|
|
|
return 0;
|
2004-12-09 14:48:56 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-09 12:51:31 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* SwapMouseButton (USER32.@)
|
2005-08-25 21:18:49 +02:00
|
|
|
* Reverse or restore the meaning of the left and right mouse buttons
|
|
|
|
* fSwap [I ] TRUE - reverse, FALSE - original
|
|
|
|
* RETURN
|
|
|
|
* previous state
|
2005-03-09 12:51:31 +01:00
|
|
|
*/
|
|
|
|
BOOL WINAPI SwapMouseButton( BOOL fSwap )
|
|
|
|
{
|
2005-08-25 21:18:49 +02:00
|
|
|
BOOL prev = GetSystemMetrics(SM_SWAPBUTTON);
|
|
|
|
SystemParametersInfoW(SPI_SETMOUSEBUTTONSWAP, fSwap, 0, 0);
|
|
|
|
return prev;
|
2005-03-09 12:51:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-12-06 23:28:43 +01:00
|
|
|
/**********************************************************************
|
|
|
|
* SetDoubleClickTime (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI SetDoubleClickTime( UINT interval )
|
|
|
|
{
|
2004-03-04 02:41:11 +01:00
|
|
|
return SystemParametersInfoW(SPI_SETDOUBLECLICKTIME, interval, 0, 0);
|
2001-12-06 23:28:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* GetDoubleClickTime (USER32.@)
|
|
|
|
*/
|
|
|
|
UINT WINAPI GetDoubleClickTime(void)
|
|
|
|
{
|
2005-07-15 18:35:27 +02:00
|
|
|
UINT time = 0;
|
|
|
|
|
2012-11-13 15:10:05 +01:00
|
|
|
get_entry( &entry_DOUBLECLICKTIME, 0, &time );
|
2005-07-15 18:35:27 +02:00
|
|
|
if (!time) time = 500;
|
|
|
|
return time;
|
2001-12-06 23:28:43 +01:00
|
|
|
}
|
2005-05-25 19:56:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* GetSysColor (USER32.@)
|
|
|
|
*/
|
2011-06-14 22:24:31 +02:00
|
|
|
COLORREF WINAPI DECLSPEC_HOTPATCH GetSysColor( INT nIndex )
|
2005-05-25 19:56:35 +02:00
|
|
|
{
|
2012-11-19 15:18:44 +01:00
|
|
|
COLORREF ret = 0;
|
|
|
|
|
|
|
|
if (nIndex >= 0 && nIndex < NUM_SYS_COLORS) get_entry( &system_colors[nIndex], 0, &ret );
|
|
|
|
return ret;
|
2005-05-25 19:56:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SetSysColors (USER32.@)
|
|
|
|
*/
|
2012-11-19 15:18:44 +01:00
|
|
|
BOOL WINAPI SetSysColors( INT count, const INT *colors, const COLORREF *values )
|
2005-05-25 19:56:35 +02:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2012-11-19 15:18:44 +01:00
|
|
|
if (IS_INTRESOURCE(colors)) return FALSE; /* stupid app passes a color instead of an array */
|
2011-05-05 13:35:59 +02:00
|
|
|
|
2012-11-19 15:18:44 +01:00
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
if (colors[i] >= 0 && colors[i] <= NUM_SYS_COLORS)
|
|
|
|
set_entry( &system_colors[colors[i]], values[i], 0, 0 );
|
2005-05-25 19:56:35 +02:00
|
|
|
|
|
|
|
/* Send WM_SYSCOLORCHANGE message to all windows */
|
|
|
|
|
|
|
|
SendMessageTimeoutW( HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0, SMTO_ABORTIFHUNG, 2000, NULL );
|
|
|
|
|
|
|
|
/* Repaint affected portions of all visible windows */
|
|
|
|
|
|
|
|
RedrawWindow( GetDesktopWindow(), NULL, 0,
|
|
|
|
RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN );
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SetSysColorsTemp (USER32.@)
|
|
|
|
*/
|
2010-04-09 13:58:14 +02:00
|
|
|
DWORD_PTR WINAPI SetSysColorsTemp( const COLORREF *pPens, const HBRUSH *pBrushes, DWORD_PTR n)
|
2005-05-25 19:56:35 +02:00
|
|
|
{
|
2012-11-19 15:18:44 +01:00
|
|
|
FIXME( "no longer supported\n" );
|
2005-05-25 19:56:35 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetSysColorBrush (USER32.@)
|
|
|
|
*/
|
2011-06-14 22:24:31 +02:00
|
|
|
HBRUSH WINAPI DECLSPEC_HOTPATCH GetSysColorBrush( INT index )
|
2005-05-25 19:56:35 +02:00
|
|
|
{
|
2012-11-19 15:18:44 +01:00
|
|
|
if (index < 0 || index >= NUM_SYS_COLORS) return 0;
|
|
|
|
|
|
|
|
if (!system_colors[index].brush)
|
|
|
|
{
|
|
|
|
HBRUSH brush = CreateSolidBrush( GetSysColor( index ));
|
|
|
|
__wine_make_gdi_object_system( brush, TRUE );
|
|
|
|
if (InterlockedCompareExchangePointer( (void **)&system_colors[index].brush, brush, 0 ))
|
|
|
|
{
|
|
|
|
__wine_make_gdi_object_system( brush, FALSE );
|
|
|
|
DeleteObject( brush );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return system_colors[index].brush;
|
2005-05-25 19:56:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* SYSCOLOR_GetPen
|
|
|
|
*/
|
|
|
|
HPEN SYSCOLOR_GetPen( INT index )
|
|
|
|
{
|
|
|
|
/* We can assert here, because this function is internal to Wine */
|
|
|
|
assert (0 <= index && index < NUM_SYS_COLORS);
|
2012-11-19 15:18:44 +01:00
|
|
|
|
|
|
|
if (!system_colors[index].pen)
|
|
|
|
{
|
|
|
|
HPEN pen = CreatePen( PS_SOLID, 1, GetSysColor( index ));
|
|
|
|
__wine_make_gdi_object_system( pen, TRUE );
|
|
|
|
if (InterlockedCompareExchangePointer( (void **)&system_colors[index].pen, pen, 0 ))
|
|
|
|
{
|
|
|
|
__wine_make_gdi_object_system( pen, FALSE );
|
|
|
|
DeleteObject( pen );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return system_colors[index].pen;
|
2005-05-25 19:56:35 +02:00
|
|
|
}
|
2005-05-25 20:42:37 +02:00
|
|
|
|
|
|
|
|
2013-10-16 16:07:53 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* SYSCOLOR_Get55AABrush
|
|
|
|
*/
|
|
|
|
HBRUSH SYSCOLOR_Get55AABrush(void)
|
|
|
|
{
|
|
|
|
static const WORD pattern[] = { 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa };
|
|
|
|
static HBRUSH brush_55aa;
|
|
|
|
|
|
|
|
if (!brush_55aa)
|
|
|
|
{
|
|
|
|
HBITMAP bitmap = CreateBitmap( 8, 8, 1, 1, pattern );
|
|
|
|
HBRUSH brush = CreatePatternBrush( bitmap );
|
|
|
|
DeleteObject( bitmap );
|
|
|
|
__wine_make_gdi_object_system( brush, TRUE );
|
|
|
|
if (InterlockedCompareExchangePointer( (void **)&brush_55aa, brush, 0 ))
|
|
|
|
{
|
|
|
|
__wine_make_gdi_object_system( brush, FALSE );
|
|
|
|
DeleteObject( brush );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return brush_55aa;
|
|
|
|
}
|
|
|
|
|
2005-05-25 20:42:37 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* ChangeDisplaySettingsA (USER32.@)
|
|
|
|
*/
|
|
|
|
LONG WINAPI ChangeDisplaySettingsA( LPDEVMODEA devmode, DWORD flags )
|
|
|
|
{
|
2008-05-18 11:47:14 +02:00
|
|
|
if (devmode) devmode->dmDriverExtra = 0;
|
|
|
|
|
2005-05-25 20:42:37 +02:00
|
|
|
return ChangeDisplaySettingsExA(NULL,devmode,NULL,flags,NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ChangeDisplaySettingsW (USER32.@)
|
|
|
|
*/
|
|
|
|
LONG WINAPI ChangeDisplaySettingsW( LPDEVMODEW devmode, DWORD flags )
|
|
|
|
{
|
2008-05-18 11:47:14 +02:00
|
|
|
if (devmode) devmode->dmDriverExtra = 0;
|
|
|
|
|
2005-05-25 20:42:37 +02:00
|
|
|
return ChangeDisplaySettingsExW(NULL,devmode,NULL,flags,NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ChangeDisplaySettingsExA (USER32.@)
|
|
|
|
*/
|
|
|
|
LONG WINAPI ChangeDisplaySettingsExA( LPCSTR devname, LPDEVMODEA devmode, HWND hwnd,
|
|
|
|
DWORD flags, LPVOID lparam )
|
|
|
|
{
|
|
|
|
LONG ret;
|
|
|
|
UNICODE_STRING nameW;
|
|
|
|
|
|
|
|
if (devname) RtlCreateUnicodeStringFromAsciiz(&nameW, devname);
|
|
|
|
else nameW.Buffer = NULL;
|
|
|
|
|
|
|
|
if (devmode)
|
|
|
|
{
|
2007-11-01 07:22:41 +01:00
|
|
|
DEVMODEW *devmodeW;
|
|
|
|
|
|
|
|
devmodeW = GdiConvertToDevmodeW(devmode);
|
2007-12-20 07:50:30 +01:00
|
|
|
if (devmodeW)
|
|
|
|
{
|
|
|
|
ret = ChangeDisplaySettingsExW(nameW.Buffer, devmodeW, hwnd, flags, lparam);
|
|
|
|
HeapFree(GetProcessHeap(), 0, devmodeW);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ret = DISP_CHANGE_SUCCESSFUL;
|
2005-05-25 20:42:37 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ret = ChangeDisplaySettingsExW(nameW.Buffer, NULL, hwnd, flags, lparam);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (devname) RtlFreeUnicodeString(&nameW);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ChangeDisplaySettingsExW (USER32.@)
|
|
|
|
*/
|
|
|
|
LONG WINAPI ChangeDisplaySettingsExW( LPCWSTR devname, LPDEVMODEW devmode, HWND hwnd,
|
|
|
|
DWORD flags, LPVOID lparam )
|
|
|
|
{
|
2005-07-18 17:14:56 +02:00
|
|
|
return USER_Driver->pChangeDisplaySettingsEx( devname, devmode, hwnd, flags, lparam );
|
2005-05-25 20:42:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-02-19 09:42:05 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* DisplayConfigGetDeviceInfo (USER32.@)
|
|
|
|
*/
|
|
|
|
LONG WINAPI DisplayConfigGetDeviceInfo(DISPLAYCONFIG_DEVICE_INFO_HEADER *packet)
|
|
|
|
{
|
|
|
|
FIXME("stub: %p\n", packet);
|
|
|
|
return ERROR_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
2005-05-25 20:42:37 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* EnumDisplaySettingsW (USER32.@)
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* TRUE if nth setting exists found (described in the LPDEVMODEW struct)
|
|
|
|
* FALSE if we do not have the nth setting
|
|
|
|
*/
|
|
|
|
BOOL WINAPI EnumDisplaySettingsW( LPCWSTR name, DWORD n, LPDEVMODEW devmode )
|
|
|
|
{
|
|
|
|
return EnumDisplaySettingsExW(name, n, devmode, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* EnumDisplaySettingsA (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI EnumDisplaySettingsA(LPCSTR name,DWORD n,LPDEVMODEA devmode)
|
|
|
|
{
|
|
|
|
return EnumDisplaySettingsExA(name, n, devmode, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* EnumDisplaySettingsExA (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI EnumDisplaySettingsExA(LPCSTR lpszDeviceName, DWORD iModeNum,
|
|
|
|
LPDEVMODEA lpDevMode, DWORD dwFlags)
|
|
|
|
{
|
|
|
|
DEVMODEW devmodeW;
|
|
|
|
BOOL ret;
|
|
|
|
UNICODE_STRING nameW;
|
|
|
|
|
|
|
|
if (lpszDeviceName) RtlCreateUnicodeStringFromAsciiz(&nameW, lpszDeviceName);
|
|
|
|
else nameW.Buffer = NULL;
|
|
|
|
|
|
|
|
ret = EnumDisplaySettingsExW(nameW.Buffer,iModeNum,&devmodeW,dwFlags);
|
|
|
|
if (ret)
|
|
|
|
{
|
2008-05-04 05:38:58 +02:00
|
|
|
lpDevMode->dmSize = FIELD_OFFSET(DEVMODEA, dmICMMethod);
|
2007-11-01 07:22:41 +01:00
|
|
|
lpDevMode->dmSpecVersion = devmodeW.dmSpecVersion;
|
|
|
|
lpDevMode->dmDriverVersion = devmodeW.dmDriverVersion;
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, devmodeW.dmDeviceName, -1,
|
|
|
|
(LPSTR)lpDevMode->dmDeviceName, CCHDEVICENAME, NULL, NULL);
|
|
|
|
lpDevMode->dmDriverExtra = 0; /* FIXME */
|
2005-05-25 20:42:37 +02:00
|
|
|
lpDevMode->dmBitsPerPel = devmodeW.dmBitsPerPel;
|
|
|
|
lpDevMode->dmPelsHeight = devmodeW.dmPelsHeight;
|
|
|
|
lpDevMode->dmPelsWidth = devmodeW.dmPelsWidth;
|
2007-11-05 12:35:10 +01:00
|
|
|
lpDevMode->u2.dmDisplayFlags = devmodeW.u2.dmDisplayFlags;
|
2005-05-25 20:42:37 +02:00
|
|
|
lpDevMode->dmDisplayFrequency = devmodeW.dmDisplayFrequency;
|
|
|
|
lpDevMode->dmFields = devmodeW.dmFields;
|
2007-11-01 07:22:41 +01:00
|
|
|
|
2007-11-05 12:35:10 +01:00
|
|
|
lpDevMode->u1.s2.dmPosition.x = devmodeW.u1.s2.dmPosition.x;
|
|
|
|
lpDevMode->u1.s2.dmPosition.y = devmodeW.u1.s2.dmPosition.y;
|
|
|
|
lpDevMode->u1.s2.dmDisplayOrientation = devmodeW.u1.s2.dmDisplayOrientation;
|
|
|
|
lpDevMode->u1.s2.dmDisplayFixedOutput = devmodeW.u1.s2.dmDisplayFixedOutput;
|
2005-05-25 20:42:37 +02:00
|
|
|
}
|
|
|
|
if (lpszDeviceName) RtlFreeUnicodeString(&nameW);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* EnumDisplaySettingsExW (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR lpszDeviceName, DWORD iModeNum,
|
|
|
|
LPDEVMODEW lpDevMode, DWORD dwFlags)
|
|
|
|
{
|
2005-07-18 17:14:56 +02:00
|
|
|
return USER_Driver->pEnumDisplaySettingsEx(lpszDeviceName, iModeNum, lpDevMode, dwFlags);
|
2005-05-25 20:42:37 +02:00
|
|
|
}
|
2008-01-10 12:57:05 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* SetProcessDPIAware (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI SetProcessDPIAware( VOID )
|
|
|
|
{
|
|
|
|
FIXME( "stub!\n");
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2016-04-01 08:18:30 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* IsProcessDPIAware (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI IsProcessDPIAware(void)
|
|
|
|
{
|
|
|
|
FIXME( "stub!\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|