ReactOS 0.4.16-dev-320-g3bd9ddc
desk.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <wingdi.h>
#include <winuser.h>
#include <wincon.h>
#include <commdlg.h>
#include <cpl.h>
#include <tchar.h>
#include <setupapi.h>
#include <shlobj.h>
#include <regstr.h>
#include <dll/desk/deskcplx.h>
#include <strsafe.h>
#include <gdiplus.h>
#include "appearance.h"
#include "preview.h"
#include "draw.h"
#include "monslctl.h"
#include "resource.h"
Include dependency graph for desk.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _APPLET
 
struct  _DIBITMAP
 
struct  HIDE_ICON
 
struct  _ICON_PATH
 
struct  _ICON_DATA
 
struct  _DESKTOP_DATA
 
struct  _RESOLUTION_INFO
 
struct  _SETTINGS_ENTRY
 
struct  _DISPLAY_DEVICE_ENTRY
 
struct  _GLOBAL_DATA
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define COBJMACROS
 
#define MONITOR_LEFT   20
 
#define MONITOR_TOP   8
 
#define MONITOR_RIGHT   140
 
#define MONITOR_BOTTOM   92
 
#define MONITOR_WIDTH   (MONITOR_RIGHT-MONITOR_LEFT)
 
#define MONITOR_HEIGHT   (MONITOR_BOTTOM-MONITOR_TOP)
 
#define MONITOR_ALPHA   0xFF00FF
 
#define MAX_DESK_PAGES   32
 
#define NUM_SPECTRUM_BITMAPS   3
 
#define NUM_DESKTOP_ICONS   4 /* DesktopIcons array size */
 
#define NUM_CHANGE_ICONS   5 /* IconChange array size */
 

Typedefs

typedef struct _APPLET APPLET
 
typedef struct _APPLETPAPPLET
 
typedef struct _DIBITMAP DIBITMAP
 
typedef struct _DIBITMAPPDIBITMAP
 
typedef struct _ICON_PATH ICON_PATH
 
typedef struct _ICON_DATA ICON_DATA
 
typedef struct _DESKTOP_DATA DESKTOP_DATA
 
typedef struct _DESKTOP_DATAPDESKTOP_DATA
 
typedef struct _RESOLUTION_INFO RESOLUTION_INFO
 
typedef struct _RESOLUTION_INFOPRESOLUTION_INFO
 
typedef struct _SETTINGS_ENTRY SETTINGS_ENTRY
 
typedef struct _SETTINGS_ENTRYPSETTINGS_ENTRY
 
typedef struct _DISPLAY_DEVICE_ENTRY DISPLAY_DEVICE_ENTRY
 
typedef struct _DISPLAY_DEVICE_ENTRYPDISPLAY_DEVICE_ENTRY
 
typedef struct _GLOBAL_DATA GLOBAL_DATA
 
typedef struct _GLOBAL_DATAPGLOBAL_DATA
 

Functions

HMENU LoadPopupMenu (IN HINSTANCE hInstance, IN LPCTSTR lpMenuName)
 
PDIBITMAP DibLoadImage (LPTSTR lpFilename)
 
VOID DibFreeImage (PDIBITMAP lpBitmap)
 
INT AllocAndLoadString (LPTSTR *lpTarget, HINSTANCE hInst, UINT uID)
 
ULONG __cdecl DbgPrint (PCCH Format,...)
 
BOOL DisplayAdvancedSettings (HWND hWndParent, PDISPLAY_DEVICE_ENTRY DisplayDevice)
 
IDataObjectCreateDevSettings (PDISPLAY_DEVICE_ENTRY DisplayDeviceInfo)
 
HPSXA WINAPI SHCreatePropSheetExtArrayEx (HKEY, LPCWSTR, UINT, IDataObject *)
 
INT_PTR CALLBACK AdvGeneralPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL SwitchDisplayMode (HWND hwndDlg, PWSTR DeviceName, PSETTINGS_ENTRY seInit, PSETTINGS_ENTRY seNew, OUT PLONG rc)
 
INT_PTR CALLBACK DesktopPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
VOID InitDesktopSettings (PDESKTOP_DATA pData)
 
BOOL SaveDesktopSettings (PDESKTOP_DATA pData)
 
VOID SetDesktopSettings (PDESKTOP_DATA pData)
 
LONG RegLoadMUIStringW (IN HKEY hKey, IN LPCWSTR pszValue OPTIONAL, OUT LPWSTR pszOutBuf, IN DWORD cbOutBuf, OUT LPDWORD pcbData OPTIONAL, IN DWORD Flags, IN LPCWSTR pszDirectory OPTIONAL)
 

Variables

HINSTANCE hApplet
 
GLOBAL_DATA g_GlobalData
 
HWND hCPLWindow
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 7 of file desk.h.

◆ COBJMACROS

#define COBJMACROS

Definition at line 10 of file desk.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 8 of file desk.h.

◆ MAX_DESK_PAGES

#define MAX_DESK_PAGES   32

Definition at line 81 of file desk.h.

◆ MONITOR_ALPHA

#define MONITOR_ALPHA   0xFF00FF

Definition at line 79 of file desk.h.

◆ MONITOR_BOTTOM

#define MONITOR_BOTTOM   92

Definition at line 74 of file desk.h.

◆ MONITOR_HEIGHT

#define MONITOR_HEIGHT   (MONITOR_BOTTOM-MONITOR_TOP)

Definition at line 77 of file desk.h.

◆ MONITOR_LEFT

#define MONITOR_LEFT   20

Definition at line 71 of file desk.h.

◆ MONITOR_RIGHT

#define MONITOR_RIGHT   140

Definition at line 73 of file desk.h.

◆ MONITOR_TOP

#define MONITOR_TOP   8

Definition at line 72 of file desk.h.

◆ MONITOR_WIDTH

#define MONITOR_WIDTH   (MONITOR_RIGHT-MONITOR_LEFT)

Definition at line 76 of file desk.h.

◆ NUM_CHANGE_ICONS

#define NUM_CHANGE_ICONS   5 /* IconChange array size */

Definition at line 85 of file desk.h.

◆ NUM_DESKTOP_ICONS

#define NUM_DESKTOP_ICONS   4 /* DesktopIcons array size */

Definition at line 84 of file desk.h.

◆ NUM_SPECTRUM_BITMAPS

#define NUM_SPECTRUM_BITMAPS   3

Definition at line 82 of file desk.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 6 of file desk.h.

Typedef Documentation

◆ APPLET

◆ DESKTOP_DATA

◆ DIBITMAP

◆ DISPLAY_DEVICE_ENTRY

◆ GLOBAL_DATA

◆ ICON_DATA

◆ ICON_PATH

◆ PAPPLET

typedef struct _APPLET * PAPPLET

◆ PDESKTOP_DATA

◆ PDIBITMAP

◆ PDISPLAY_DEVICE_ENTRY

◆ PGLOBAL_DATA

◆ PRESOLUTION_INFO

◆ PSETTINGS_ENTRY

◆ RESOLUTION_INFO

◆ SETTINGS_ENTRY

Function Documentation

◆ AdvGeneralPageProc()

INT_PTR CALLBACK AdvGeneralPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 115 of file general.c.

119{
120 PDISPLAY_DEVICE_ENTRY DispDevice = NULL;
121 INT_PTR Ret = 0;
122
123 if (uMsg != WM_INITDIALOG)
124 DispDevice = (PDISPLAY_DEVICE_ENTRY)GetWindowLongPtr(hwndDlg, DWLP_USER);
125
126 switch (uMsg)
127 {
128 case WM_INITDIALOG:
130 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)DispDevice);
131
132 InitFontSizeList(hwndDlg);
133 InitRadioButtons(hwndDlg);
134
135 Ret = TRUE;
136 break;
137 case WM_COMMAND:
138 switch (LOWORD(wParam))
139 {
142 {
143 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
144 }
145 break;
146 case IDC_RESTART_RB:
148 case IDC_ASKME_RB:
149 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
150 break;
151 }
152 break;
153 }
154
155 return Ret;
156}
struct _DISPLAY_DEVICE_ENTRY * PDISPLAY_DEVICE_ENTRY
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
static VOID InitRadioButtons(HWND hWnd)
Definition: general.c:78
static VOID InitFontSizeList(HWND hWnd)
Definition: general.c:11
#define IDC_RESTART_RB
Definition: resource.h:196
#define IDC_FONTSIZE_COMBO
Definition: resource.h:194
#define IDC_WITHOUTREBOOT_RB
Definition: resource.h:197
#define IDC_ASKME_RB
Definition: resource.h:198
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LOWORD(l)
Definition: pedump.c:82
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define LPPROPSHEETPAGE
Definition: prsht.h:390
Definition: precomp.h:68
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT_PTR
Definition: typedefs.h:64
#define HIWORD(l)
Definition: typedefs.h:247
#define DWLP_USER
Definition: winuser.h:875
#define WM_COMMAND
Definition: winuser.h:1743
#define WM_INITDIALOG
Definition: winuser.h:1742
#define CBN_SELCHANGE
Definition: winuser.h:1982
HWND WINAPI GetParent(_In_ HWND)

Referenced by DisplayAdvancedSettings().

◆ AllocAndLoadString()

INT AllocAndLoadString ( LPTSTR lpTarget,
HINSTANCE  hInst,
UINT  uID 
)

◆ CreateDevSettings()

IDataObject * CreateDevSettings ( PDISPLAY_DEVICE_ENTRY  DisplayDeviceInfo)

Definition at line 1045 of file devsett.c.

1046{
1048
1050 0,
1051 sizeof(*This));
1052 if (This != NULL)
1053 {
1054 This->lpIDataObjectVtbl = &vtblIDataObject;
1055 This->ref = 1;
1056
1058 DisplayDeviceInfo)))
1059 {
1061 }
1062
1064 }
1065
1066 return NULL;
1067}
static const struct IDataObjectVtbl vtblIDataObject
Definition: devsett.c:1029
#define impl_to_interface(impl, iface)
Definition: devsett.c:59
static ULONG STDMETHODCALLTYPE CDevSettings_Release(IDataObject *iface)
Definition: devsett.c:696
static HRESULT pCDevSettings_Initialize(PCDevSettings This, PDISPLAY_DEVICE_ENTRY DisplayDeviceInfo)
Definition: devsett.c:493
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define SUCCEEDED(hr)
Definition: intsafe.h:50

Referenced by DisplayAdvancedSettings().

◆ DbgPrint()

ULONG __cdecl DbgPrint ( PCCH  Format,
  ... 
)

Definition at line 428 of file debug.c.

429{
430 return 0;
431}

◆ DesktopPageProc()

INT_PTR CALLBACK DesktopPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Referenced by OnCustomButton().

◆ DibFreeImage()

VOID DibFreeImage ( PDIBITMAP  lpBitmap)

Definition at line 90 of file dibitmap.c.

91{
92 if (lpBitmap == NULL)
93 return;
94
95 /* Free the image data */
96 if (lpBitmap->bits != NULL)
97 HeapFree(GetProcessHeap(), 0, lpBitmap->bits);
98
99 /* Free the bitmap info */
100 if (lpBitmap->info != NULL)
101 HeapFree(GetProcessHeap(), 0, lpBitmap->info);
102
103 /* Free the bitmap structure */
104 if (lpBitmap != NULL)
105 HeapFree(GetProcessHeap(), 0, lpBitmap);
106}
#define HeapFree(x, y, z)
Definition: compat.h:735
BYTE * bits
Definition: desk.h:46
BITMAPINFO * info
Definition: desk.h:45

Referenced by BackgroundPageProc(), and ListViewItemChanged().

◆ DibLoadImage()

PDIBITMAP DibLoadImage ( LPTSTR  lpFilename)

Definition at line 13 of file dibitmap.c.

14{
15 PDIBITMAP lpBitmap;
18
19 if (GdipCreateBitmapFromFile(lpFilename, &bitmap) != Ok)
20 {
21 return NULL;
22 }
23
24 lpBitmap = HeapAlloc(GetProcessHeap(), 0, sizeof(DIBITMAP));
25 if (lpBitmap == NULL)
26 {
28 return NULL;
29 }
30
31 lpBitmap->info = HeapAlloc(GetProcessHeap(), 0, sizeof(BITMAPINFO));
32 if (lpBitmap->info == NULL)
33 {
34 HeapFree(GetProcessHeap(), 0, lpBitmap);
36 return NULL;
37 }
38
39 if (GdipGetImageWidth((GpImage*)bitmap, &lpBitmap->width) != Ok ||
40 GdipGetImageHeight((GpImage*)bitmap, &lpBitmap->height) != Ok)
41 {
42 HeapFree(GetProcessHeap(), 0, lpBitmap->info);
43 HeapFree(GetProcessHeap(), 0, lpBitmap);
45 return NULL;
46 }
47
48 lpBitmap->bits = HeapAlloc(GetProcessHeap(), 0, lpBitmap->width * lpBitmap->height * 4);
49 if (!lpBitmap->bits)
50 {
51 HeapFree(GetProcessHeap(), 0, lpBitmap->info);
52 HeapFree(GetProcessHeap(), 0, lpBitmap);
54 return NULL;
55 }
56
57 ZeroMemory(lpBitmap->info, sizeof(BITMAPINFO));
58 lpBitmap->info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
59 lpBitmap->info->bmiHeader.biWidth = lpBitmap->width;
60 lpBitmap->info->bmiHeader.biHeight = -(INT)lpBitmap->height;
61 lpBitmap->info->bmiHeader.biPlanes = 1;
62 lpBitmap->info->bmiHeader.biBitCount = 32;
64 lpBitmap->info->bmiHeader.biSizeImage = lpBitmap->width * lpBitmap->height * 4;
65
66 lock.Width = lpBitmap->width;
67 lock.Height = lpBitmap->height;
68 lock.Stride = lpBitmap->width * 4;
69 lock.PixelFormat = PixelFormat32bppPARGB;
70 lock.Scan0 = lpBitmap->bits;
71 lock.Reserved = 0;
72
74 {
75 HeapFree(GetProcessHeap(), 0, lpBitmap->bits);
76 HeapFree(GetProcessHeap(), 0, lpBitmap->info);
77 HeapFree(GetProcessHeap(), 0, lpBitmap);
79 return NULL;
80 }
81
84
85 return lpBitmap;
86}
GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR *filename, GpBitmap **bitmap)
Definition: image.c:1360
GpStatus WINGDIPAPI GdipGetImageWidth(GpImage *image, UINT *width)
Definition: image.c:2390
GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height)
Definition: image.c:2287
GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap *bitmap, GDIPCONST GpRect *rect, UINT flags, PixelFormat format, BitmapData *lockeddata)
Definition: image.c:1030
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
Definition: image.c:2155
GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap *bitmap, BitmapData *lockeddata)
Definition: image.c:1176
#define BI_RGB
Definition: precomp.h:56
@ ImageLockModeUserInputBuf
@ ImageLockModeRead
#define PixelFormat32bppPARGB
@ Ok
Definition: gdiplustypes.h:26
if(dx< 0)
Definition: linetemp.h:194
#define INT
Definition: polytest.cpp:20
Definition: desk.h:44
UINT height
Definition: desk.h:48
UINT width
Definition: desk.h:47
Definition: uimain.c:89
USHORT biBitCount
Definition: precomp.h:46
ULONG biCompression
Definition: precomp.h:47
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1476
rwlock_t lock
Definition: tcpcore.h:0
#define ZeroMemory
Definition: winbase.h:1737

Referenced by ListViewItemChanged().

◆ DisplayAdvancedSettings()

BOOL DisplayAdvancedSettings ( HWND  hWndParent,
PDISPLAY_DEVICE_ENTRY  DisplayDevice 
)

Definition at line 77 of file advmon.c.

78{
79 TCHAR szCaption[128];
82 HPSXA hpsxaDev, hpsxaDisp;
83 BOOL Ret;
84 IDataObject *pdo;
85
86 /* FIXME: Build the "%s and %s" caption string for the monitor and adapter name */
87 szCaption[0] = _T('\0');
88
89 ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
90 psh.dwSize = sizeof(PROPSHEETHEADER);
91 psh.dwFlags = PSH_PROPTITLE;
92 psh.hwndParent = hWndParent;
93 psh.hInstance = hApplet;
94 psh.pszCaption = szCaption;
95 psh.phpage = hpsp;
96
98
99 pdo = CreateDevSettings(DisplayDevice);
100
101 if (pdo != NULL)
102 BuildAdvPropTitle(pdo, szCaption, _countof(szCaption));
103
105 if (hpsxaDev != NULL)
107
109 if (hpsxaDisp != NULL)
111
112 Ret = (LONG)(PropertySheet(&psh) != -1);
113
114 if (hpsxaDisp != NULL)
116
117 if (hpsxaDev != NULL)
119
120 IDataObject_Release(pdo);
121
122 return Ret;
123}
static BOOL CALLBACK PropSheetAddPage(HPROPSHEETPAGE hpage, LPARAM lParam)
Definition: advmon.c:12
static BOOL DisplayAdvancedSettingsInitPropSheetPage(PROPSHEETHEADER *ppsh, WORD idDlg, DLGPROC DlgProc, LPARAM lParam)
Definition: advmon.c:25
#define MAX_ADVANCED_PAGES
Definition: advmon.c:9
static VOID BuildAdvPropTitle(IDataObject *pdo, LPTSTR lpBuffer, DWORD dwBufferLen)
Definition: advmon.c:51
INT_PTR CALLBACK AdvGeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: general.c:115
HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY, LPCWSTR, UINT, IDataObject *)
IDataObject * CreateDevSettings(PDISPLAY_DEVICE_ENTRY DisplayDeviceInfo)
Definition: devsett.c:1045
HINSTANCE hApplet
Definition: access.c:17
#define IDD_ADVANCED_GENERAL
Definition: resource.h:18
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TEXT(s)
Definition: k32.h:26
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
long LONG
Definition: pedump.c:60
#define PROPSHEETHEADER
Definition: prsht.h:392
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PropertySheet
Definition: prsht.h:400
#define REGSTR_PATH_CONTROLSFOLDER
Definition: regstr.h:76
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:2395
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
Definition: shellord.c:2218
#define _countof(array)
Definition: sndvol32.h:70
#define _T(x)
Definition: vfdio.h:22
LONG_PTR LPARAM
Definition: windef.h:208
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
char TCHAR
Definition: xmlstorage.h:189

Referenced by SettingsPageProc().

◆ InitDesktopSettings()

VOID InitDesktopSettings ( PDESKTOP_DATA  pData)

Definition at line 63 of file desktop.c.

64{
65 UINT i;
66 TCHAR regPath[MAX_PATH];
67
68 /* Load desktop icon settings from the registry */
69 StringCchCopy(regPath, _countof(regPath), szHideDesktopIcons);
70 StringCchCat(regPath, _countof(regPath), szClassicStartMenu);
71
72 for (i = 0; i < _countof(pData->optIcons); i++)
73 {
74 pData->optIcons[i].bHideClassic = SHRegGetBoolUSValue(regPath, DesktopIcons[i].CLSID, FALSE, FALSE);
75 }
76
77 StringCchCopy(regPath, _countof(regPath), szHideDesktopIcons);
78 StringCchCat(regPath, _countof(regPath), szNewStartPanel);
79
80 for (i = 0; i < _countof(pData->optIcons); i++)
81 {
82 pData->optIcons[i].bHideNewStart = SHRegGetBoolUSValue(regPath, DesktopIcons[i].CLSID, FALSE, TRUE);
83 }
84
85 for (i = 0; i < _countof(IconChange); i++)
86 {
87 DWORD cbData, dwType;
88 TCHAR szData[MAX_PATH];
89
90 /* Current icons */
91 StringCchCopy(regPath, _countof(regPath), szUserClass);
92 StringCchCat(regPath, _countof(regPath), IconChange[i].CLSID);
93 StringCchCat(regPath, _countof(regPath), szDefaultIcon);
94 cbData = sizeof(szData);
95
96 if (SHGetValue(HKEY_CURRENT_USER, regPath, IconChange[i].IconName, &dwType,
97 &szData, &cbData) == ERROR_SUCCESS &&
98 (dwType == REG_SZ || dwType == REG_EXPAND_SZ))
99 {
100 StringCchCopy(pData->Icon[i].szPath, _countof(pData->Icon[i].szPath), szData);
101 }
102
103 /* Default icons */
104 /* FIXME: Get default icons from theme data, fallback to CLSID data on error. */
105 StringCchCopy(regPath, _countof(regPath), szSysClass);
106 StringCchCat(regPath, _countof(regPath), IconChange[i].CLSID);
107 StringCchCat(regPath, _countof(regPath), szDefaultIcon);
108 cbData = sizeof(szData);
109
110 if (SHGetValue(HKEY_CLASSES_ROOT, regPath, IconChange[i].IconName, &dwType,
111 &szData, &cbData) == ERROR_SUCCESS &&
112 (dwType == REG_SZ || dwType == REG_EXPAND_SZ))
113 {
114 StringCchCopy(pData->DefIcon[i].szPath, _countof(pData->DefIcon[i].szPath), szData);
115 }
116
117 /* Emergency fallback */
118 if (lstrlen(pData->DefIcon[i].szPath) == 0)
119 StringCchCopy(pData->DefIcon[i].szPath, _countof(pData->DefIcon[i].szPath), szFallbackIcon);
120
121 if (lstrlen(pData->Icon[i].szPath) == 0)
122 StringCchCopy(pData->Icon[i].szPath, _countof(pData->Icon[i].szPath), pData->DefIcon[i].szPath);
123 }
124}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FALSE
Definition: types.h:117
static const TCHAR szDefaultIcon[]
Definition: desktop.c:46
LPCTSTR IconName
Definition: desktop.c:53
static const TCHAR szClassicStartMenu[]
Definition: desktop.c:30
static const TCHAR szSysClass[]
Definition: desktop.c:45
struct @213 IconChange[NUM_CHANGE_ICONS]
struct @212 DesktopIcons[NUM_DESKTOP_ICONS]
static const TCHAR szNewStartPanel[]
Definition: desktop.c:31
static const TCHAR szFallbackIcon[]
Definition: desktop.c:47
static const TCHAR szHideDesktopIcons[]
Definition: desktop.c:29
static const TCHAR szUserClass[]
Definition: desktop.c:44
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define REG_SZ
Definition: layer.c:22
unsigned int UINT
Definition: ndis.h:50
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define SHRegGetBoolUSValue
Definition: shlwapi.h:574
#define SHGetValue
Definition: shlwapi.h:70
#define StringCchCopy
Definition: strsafe.h:139
#define StringCchCat
Definition: strsafe.h:317
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
#define lstrlen
Definition: winbase.h:3901
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

Referenced by BackgroundPageProc().

◆ LoadPopupMenu()

HMENU LoadPopupMenu ( IN HINSTANCE  hInstance,
IN LPCTSTR  lpMenuName 
)

Definition at line 52 of file desk.c.

54{
55 HMENU hMenu, hSubMenu = NULL;
56
57 hMenu = LoadMenu(hInstance,
58 lpMenuName);
59
60 if (hMenu != NULL)
61 {
62 hSubMenu = GetSubMenu(hMenu,
63 0);
64 if (hSubMenu != NULL &&
65 !RemoveMenu(hMenu,
66 0,
68 {
69 hSubMenu = NULL;
70 }
71
72 DestroyMenu(hMenu);
73 }
74
75 return hSubMenu;
76}
HINSTANCE hInstance
Definition: charmap.c:19
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define MF_BYPOSITION
Definition: winuser.h:203
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define LoadMenu
Definition: winuser.h:5829
BOOL WINAPI DestroyMenu(_In_ HMENU)

◆ RegLoadMUIStringW()

LONG RegLoadMUIStringW ( IN HKEY  hKey,
IN LPCWSTR pszValue  OPTIONAL,
OUT LPWSTR  pszOutBuf,
IN DWORD  cbOutBuf,
OUT LPDWORD pcbData  OPTIONAL,
IN DWORD  Flags,
IN LPCWSTR pszDirectory  OPTIONAL 
)

Definition at line 53 of file muireg.c.

60{
61 DWORD dwValueType, cbData;
62 LPWSTR pwszTempBuffer = NULL, pwszExpandedBuffer = NULL;
64
65 /* Parameter sanity checks. */
66 if (!hKey || !pszOutBuf)
68
69 if (pszDirectory && *pszDirectory)
70 {
71 //FIXME("BaseDir parameter not yet supported!\n");
73 }
74
75 /* Check for value existence and correctness of it's type, allocate a buffer and load it. */
76 result = RegQueryValueExW(hKey, pszValue, NULL, &dwValueType, NULL, &cbData);
77 if (result != ERROR_SUCCESS) goto cleanup;
78 if (!(dwValueType == REG_SZ || dwValueType == REG_EXPAND_SZ) || !cbData)
79 {
81 goto cleanup;
82 }
83 pwszTempBuffer = HeapAlloc(GetProcessHeap(), 0, cbData);
84 if (!pwszTempBuffer)
85 {
87 goto cleanup;
88 }
89 result = RegQueryValueExW(hKey, pszValue, NULL, &dwValueType, (LPBYTE)pwszTempBuffer, &cbData);
90 if (result != ERROR_SUCCESS) goto cleanup;
91
92 /* Expand environment variables, if appropriate, or copy the original string over. */
93 if (dwValueType == REG_EXPAND_SZ)
94 {
95 cbData = ExpandEnvironmentStringsW(pwszTempBuffer, NULL, 0) * sizeof(WCHAR);
96 if (!cbData) goto cleanup;
97 pwszExpandedBuffer = HeapAlloc(GetProcessHeap(), 0, cbData);
98 if (!pwszExpandedBuffer)
99 {
101 goto cleanup;
102 }
103 ExpandEnvironmentStringsW(pwszTempBuffer, pwszExpandedBuffer, cbData);
104 }
105 else
106 {
107 pwszExpandedBuffer = HeapAlloc(GetProcessHeap(), 0, cbData);
108 memcpy(pwszExpandedBuffer, pwszTempBuffer, cbData);
109 }
110
111 /* If the value references a resource based string, parse the value and load the string.
112 * Else just copy over the original value. */
114 if (*pwszExpandedBuffer != L'@') /* '@' is the prefix for resource based string entries. */
115 {
116 lstrcpynW(pszOutBuf, pwszExpandedBuffer, cbOutBuf / sizeof(WCHAR));
117 }
118 else
119 {
120 WCHAR *pComma = wcsrchr(pwszExpandedBuffer, L',');
121 UINT uiStringId;
123
124 /* Format of the expanded value is 'path_to_dll,-resId' */
125 if (!pComma || pComma[1] != L'-')
126 {
128 goto cleanup;
129 }
130
131 uiStringId = _wtoi(pComma+2);
132 *pComma = L'\0';
133
134 hModule = LoadLibraryExW(pwszExpandedBuffer + 1, NULL, LOAD_LIBRARY_AS_DATAFILE);
135 if (!hModule || !load_string(hModule, uiStringId, pszOutBuf, cbOutBuf / sizeof(WCHAR)))
138 }
139
140cleanup:
141 HeapFree(GetProcessHeap(), 0, pwszTempBuffer);
142 HeapFree(GetProcessHeap(), 0, pwszExpandedBuffer);
143 return result;
144}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
HMODULE hModule
Definition: animate.c:44
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define wcsrchr
Definition: compat.h:16
#define FreeLibrary(x)
Definition: compat.h:748
#define lstrcpynW
Definition: compat.h:738
static void cleanup(void)
Definition: main.c:1335
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
FxAutoRegKey hKey
GLuint64EXT * result
Definition: glext.h:11304
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMaxChars)
Definition: muireg.c:10
#define L(x)
Definition: ntvdm.h:50
unsigned char * LPBYTE
Definition: typedefs.h:53
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:368
#define ERROR_BADKEY
Definition: winerror.h:589
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CDefaultContextMenu::AddStaticContextMenusToMenu(), HCR_GetClassNameW(), LoadClassicColorSchemes(), LoadSchemeSizes(), RegLoadMUIStringA(), and SHELL32_AssocGetExtensionDescription().

◆ SaveDesktopSettings()

BOOL SaveDesktopSettings ( PDESKTOP_DATA  pData)

Definition at line 127 of file desktop.c.

128{
129 UINT i;
130
131 if (!pData->bLocalSettingsChanged)
132 return FALSE;
133
134 for (i = 0; i < _countof(DesktopIcons); i++)
135 {
136 if (!pData->bLocalHideChanged[i])
137 continue;
138
139 pData->optIcons[i].bHideClassic =
140 pData->optIcons[i].bHideNewStart = pData->bLocalHideIcon[i];
141 pData->bHideChanged[i] = TRUE;
142 }
143
144 for (i = 0; i < _countof(IconChange); i++)
145 {
146 if (!pData->bLocalIconChanged[i])
147 continue;
148
149 StringCchCopy(pData->Icon[i].szPath, _countof(pData->Icon[i].szPath), pData->LocalIcon[i].szPath);
150 pData->bIconChanged[i] = TRUE;
151 }
152
153 pData->bSettingsChanged = TRUE;
154 return TRUE;
155}

Referenced by OnCustomButton().

◆ SetDesktopSettings()

VOID SetDesktopSettings ( PDESKTOP_DATA  pData)

Definition at line 181 of file desktop.c.

182{
183 UINT i;
184
185 for (i = 0; i < _countof(DesktopIcons); i++)
186 {
187 if (!pData->bHideChanged[i])
188 continue;
189
190 if (GetCurrentValue(i, FALSE) != pData->optIcons[i].bHideClassic)
191 SetCurrentValue(i, FALSE, pData->optIcons[i].bHideClassic);
192
193 if (GetCurrentValue(i, TRUE) != pData->optIcons[i].bHideNewStart)
194 SetCurrentValue(i, TRUE, pData->optIcons[i].bHideNewStart);
195
196 pData->bHideChanged[i] = FALSE;
197 }
198
199 for (i = 0; i < _countof(IconChange); i++)
200 {
201 TCHAR iconPath[MAX_PATH];
202 DWORD dwType = (pData->Icon[i].szPath[0] == TEXT('%') ? REG_EXPAND_SZ : REG_SZ);
203
204 if (!pData->bIconChanged[i])
205 continue;
206
207 StringCchCopy(iconPath, _countof(iconPath), szUserClass);
208 StringCchCat(iconPath, _countof(iconPath), IconChange[i].CLSID);
209 StringCchCat(iconPath, _countof(iconPath), szDefaultIcon);
210
212 pData->Icon[i].szPath, sizeof(pData->Icon[i].szPath));
214 {
215 /* Also apply to the root value */
216 SHSetValue(HKEY_CURRENT_USER, iconPath, NULL, dwType,
217 pData->Icon[i].szPath, sizeof(pData->Icon[i].szPath));
218 }
219 pData->bIconChanged[i] = FALSE;
220 }
221
222 pData->bSettingsChanged = FALSE;
223
224 /* Refresh the desktop */
226}
static VOID SetCurrentValue(UINT i, BOOL bNewStart, BOOL bValue)
Definition: desktop.c:169
#define IDS_TITLE_BIN_0
Definition: desktop.c:19
static BOOL GetCurrentValue(UINT i, BOOL bNewStart)
Definition: desktop.c:158
#define FCIDM_DESKBROWSER_REFRESH
Definition: desktop.c:14
UINT TitleId
Definition: desktop.c:52
#define SHSetValue
Definition: shlwapi.h:92
HWND WINAPI GetShellWindow(VOID)
Definition: desktop.c:651
#define PostMessage
Definition: winuser.h:5844

Referenced by BackgroundPageProc().

◆ SHCreatePropSheetExtArrayEx()

HPSXA WINAPI SHCreatePropSheetExtArrayEx ( HKEY  ,
LPCWSTR  ,
UINT  ,
IDataObject  
)

Referenced by DisplayAdvancedSettings().

◆ SwitchDisplayMode()

BOOL SwitchDisplayMode ( HWND  hwndDlg,
PWSTR  DeviceName,
PSETTINGS_ENTRY  seInit,
PSETTINGS_ENTRY  seNew,
OUT PLONG  rc 
)

Definition at line 769 of file settings.c.

770{
771 TCHAR Message[1024], Title[256];
773
774 RtlZeroMemory(&devmode, sizeof(devmode));
775 devmode.dmSize = (WORD)sizeof(devmode);
781
782 *rc = ChangeDisplaySettingsEx(DeviceName,
783 &devmode,
784 NULL,
786 NULL);
787 switch (*rc)
788 {
790 break;
791
796 return FALSE;
797
799 default:
803 return FALSE;
804 }
805
807 {
808 return TRUE;
809 }
810 else
811 {
816
817 *rc = ChangeDisplaySettingsEx(DeviceName,
818 &devmode,
819 NULL,
821 NULL);
822 switch (*rc)
823 {
825 return FALSE;
826
831 return FALSE;
832
834 default:
838 return FALSE;
839 }
840 }
841}
DEVMODEW devmode
#define IDS_DISPLAY_SETTINGS
Definition: resource.h:161
#define IDS_APPLY_NEEDS_RESTART
Definition: resource.h:164
#define IDD_CONFIRMSETTINGS
Definition: resource.h:19
#define IDS_APPLY_FAILED
Definition: resource.h:163
static INT_PTR CALLBACK ConfirmDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: settings.c:706
static const WCHAR Title[]
Definition: oid.c:1259
static const WCHAR Message[]
Definition: register.c:74
unsigned short WORD
Definition: ntddk_ex.h:93
DWORD dmPelsHeight
Definition: precomp.h:64
DWORD dmDisplayFrequency
Definition: desk.h:138
DWORD dmBitsPerPel
Definition: precomp.h:62
DWORD dmPelsWidth
Definition: precomp.h:63
DWORD dmBitsPerPel
Definition: wingdi.h:1647
DWORD dmFields
Definition: wingdi.h:1622
DWORD dmPelsWidth
Definition: wingdi.h:1648
DWORD dmPelsHeight
Definition: wingdi.h:1649
DWORD dmDisplayFrequency
Definition: wingdi.h:1654
WORD dmSize
Definition: wingdi.h:1620
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1272
#define DM_PELSWIDTH
Definition: wingdi.h:1269
#define DM_BITSPERPEL
Definition: wingdi.h:1268
#define DM_PELSHEIGHT
Definition: wingdi.h:1270
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190
#define CDS_UPDATEREGISTRY
Definition: winuser.h:181
#define DISP_CHANGE_FAILED
Definition: winuser.h:194
#define MB_OK
Definition: winuser.h:793
#define LoadString
Definition: winuser.h:5831
#define MessageBox
Definition: winuser.h:5834
#define MB_ICONINFORMATION
Definition: winuser.h:805
#define MB_ICONSTOP
Definition: winuser.h:806
#define IDYES
Definition: winuser.h:838
#define DISP_CHANGE_RESTART
Definition: winuser.h:191
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define DialogBox
Definition: winuser.h:5773

Referenced by ApplyDisplaySettings(), and DisplaySaveSettings().

Variable Documentation

◆ g_GlobalData

◆ hApplet

HINSTANCE hApplet
extern

Definition at line 17 of file access.c.

◆ hCPLWindow

HWND hCPLWindow
extern

Definition at line 38 of file desk.c.

Referenced by DisplayApplet(), and LoadSchemeFromTheme().