ReactOS  0.4.13-dev-257-gfabbd7c
desk.c File Reference
#include "desk.h"
#include <shellapi.h>
#include <cplext.h>
#include <debug.h>
Include dependency graph for desk.c:

Go to the source code of this file.

Macros

#define NUM_APPLETS   (1)
 

Functions

static LONG APIENTRY DisplayApplet (HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK BackgroundPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK ScreenSaverPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK AppearancePageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK SettingsPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
UINT CALLBACK SettingsPageCallbackProc (HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
 
HMENU LoadPopupMenu (IN HINSTANCE hInstance, IN LPCTSTR lpMenuName)
 
static BOOL CALLBACK DisplayAppletPropSheetAddPage (HPROPSHEETPAGE hpage, LPARAM lParam)
 
static BOOL InitPropSheetPage (PROPSHEETHEADER *ppsh, WORD idDlg, DLGPROC DlgProc, LPFNPSPCALLBACK pfnCallback)
 
static int CALLBACK PropSheetProc (HWND hwndDlg, UINT uMsg, LPARAM lParam)
 
LONG CALLBACK CPlApplet (HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
 
void WINAPI InstallScreenSaverW (IN HWND hWindow, IN HANDLE hInstance, IN LPCWSTR pszFile, IN UINT nCmdShow)
 
void WINAPI InstallScreenSaverA (IN HWND hWindow, IN HANDLE hInstance, IN LPCSTR pszFile, IN UINT nCmdShow)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD dwReason, LPVOID lpvReserved)
 

Variables

HINSTANCE hApplet = 0
 
HWND hCPLWindow
 
APPLET Applets [NUM_APPLETS]
 
struct {
   WORD   idDlg
 
   DLGPROC   DlgProc
 
   LPFNPSPCALLBACK   Callback
 
   LPWSTR   Name
 
PropPages []
 

Macro Definition Documentation

◆ NUM_APPLETS

#define NUM_APPLETS   (1)

Definition at line 15 of file desk.c.

Function Documentation

◆ AppearancePageProc()

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

Definition at line 216 of file appearance.c.

217 {
218  GLOBALS *g;
219  LPNMHDR lpnm;
220 
221  g = (GLOBALS*)GetWindowLongPtr(hwndDlg, DWLP_USER);
222 
223  switch (uMsg)
224  {
225  case WM_INITDIALOG:
226  return AppearancePage_OnInit(hwndDlg);
227 
228  case WM_DESTROY:
229  AppearancePage_OnDestroy(hwndDlg, g);
230  break;
231 
232  case WM_COMMAND:
233  if (g == NULL || g->bInitializing)
234  return FALSE;
235 
236  switch (LOWORD(wParam))
237  {
240  hwndDlg, EffAppearanceDlgProc, (LPARAM)g) == IDOK)
241  {
242  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
243  g->Scheme = g->SchemeAdv;
244  g->bSchemeChanged = TRUE;
245  }
246  break;
247 
250  hwndDlg, AdvAppearanceDlgProc, (LPARAM)g) == IDOK)
251  {
252  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
253  g->bSchemeChanged = TRUE;
254  g->Scheme = g->SchemeAdv;
255  g_GlobalData.desktop_color = g->Scheme.crColor[COLOR_DESKTOP];
256 
258  }
259  break;
260 
262  if (HIWORD(wParam) == CBN_SELCHANGE)
263  {
264  g->ActiveTheme.Color = (PTHEME_STYLE)GetSelectedData(hwndDlg, IDC_APPEARANCE_COLORSCHEME);
265  if (g->ActiveTheme.Color->ChildStyle != NULL)
266  g->ActiveTheme.Size = g->ActiveTheme.Color->ChildStyle;
267 
268  g->bSchemeChanged = TRUE;
269  if (g->ActiveTheme.ThemeActive)
270  g->bThemeChanged = TRUE;
271 
272  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
273 
275  AppearancePage_ShowSizes(hwndDlg, g);
277  }
278  break;
279 
281  if (HIWORD(wParam) == CBN_SELCHANGE)
282  {
284 
285  if (g->ClassicTheme.Theme == pTheme)
286  g->ActiveTheme = g->ClassicTheme;
287  else
288  {
289  g->ActiveTheme.Theme = pTheme;
290  g->ActiveTheme.Size = pTheme->SizesList;
291  g->ActiveTheme.Color = pTheme->ColoursList;
292  g->ActiveTheme.ThemeActive = TRUE;
293  }
294 
295  g->bThemeChanged = TRUE;
296  g->bSchemeChanged = TRUE;
297 
298  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
299 
301  AppearancePage_ShowSizes(hwndDlg, g);
304  }
305  break;
306 
307  case IDC_APPEARANCE_SIZE:
308  if (HIWORD(wParam) == CBN_SELCHANGE)
309  {
310  g->ActiveTheme.Size = (PTHEME_STYLE)GetSelectedData(hwndDlg, IDC_APPEARANCE_SIZE);
311  g->bSchemeChanged = TRUE;
312  if (g->ActiveTheme.ThemeActive)
313  g->bThemeChanged = TRUE;
314 
315  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
316 
319  }
320  }
321  break;
322 
323  case WM_NOTIFY:
324  lpnm = (LPNMHDR)lParam;
325  switch (lpnm->code)
326  {
327  case PSN_APPLY:
328 
329  if (g->bThemeChanged)
330  {
331  ActivateTheme(&g->ActiveTheme);
332  }
333 
334  if (g->bSchemeChanged)
335  {
336  ApplyScheme(&g->Scheme, &g->ActiveTheme);
337  if (g->ActiveTheme.ThemeActive == FALSE)
338  g->ClassicTheme = g->ActiveTheme;
339  }
340 
342  g->bThemeChanged = FALSE;
343  g->bSchemeChanged = FALSE;
345  return TRUE;
346 
347  case PSN_KILLACTIVE:
349  return TRUE;
350 
351  case PSN_SETACTIVE:
352  if (g->Scheme.crColor[COLOR_DESKTOP] != g_GlobalData.desktop_color)
353  {
354  g->Scheme.crColor[COLOR_DESKTOP] = g_GlobalData.desktop_color;
356  }
357  break;
358  }
359  break;
360  }
361 
362  return FALSE;
363 }
BOOL ActivateTheme(PTHEME_SELECTION pSelectedTheme)
INT_PTR CALLBACK EffAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: effappdlg.c:130
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define IDC_APPEARANCE_ADVANCED
Definition: resource.h:90
static VOID AppearancePage_OnDestroy(HWND hwndDlg, GLOBALS *g)
Definition: appearance.c:197
static void AppearancePage_ShowColorSchemes(HWND hwndDlg, GLOBALS *g)
Definition: appearance.c:72
static PVOID GetSelectedData(HWND hwndDlg, int nIDDlgItem)
Definition: appearance.c:203
COLORREF desktop_color
Definition: desk.h:106
#define IDC_APPEARANCE_COLORSCHEME
Definition: resource.h:87
HINSTANCE hApplet
Definition: access.c:17
#define COLOR_DESKTOP
Definition: winuser.h:904
#define PSN_APPLY
Definition: prsht.h:117
THEME_STYLE * SizesList
Definition: appearance.h:93
#define IDC_APPEARANCE_SIZE
Definition: resource.h:92
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3112
#define PSN_KILLACTIVE
Definition: prsht.h:116
struct _THEME_STYLE * PTHEME_STYLE
static void AppearancePage_UpdateThemePreview(HWND hwndDlg, GLOBALS *g)
Definition: appearance.c:16
INT_PTR CALLBACK AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: advappdlg.c:504
smooth NULL
Definition: ftsmooth.c:416
#define IDC_APPEARANCE_VISUAL_STYLE
Definition: resource.h:91
LONG_PTR LPARAM
Definition: windef.h:208
static void AppearancePage_LoadSelectedScheme(HWND hwndDlg, GLOBALS *g)
Definition: appearance.c:35
#define WM_DESTROY
Definition: winuser.h:1591
GLboolean GLboolean g
Definition: glext.h:6204
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define PSNRET_NOERROR
Definition: prsht.h:129
#define DialogBoxParam
Definition: winuser.h:5630
#define DWLP_USER
Definition: winuser.h:866
VOID ApplyScheme(PCOLOR_SCHEME scheme, PTHEME_SELECTION pSelectedTheme)
static INT_PTR AppearancePage_OnInit(HWND hwndDlg)
Definition: appearance.c:97
#define WM_COMMAND
Definition: winuser.h:1716
THEME_STYLE * ColoursList
Definition: appearance.h:92
HWND WINAPI GetParent(_In_ HWND)
#define IDD_ADVAPPEARANCE
Definition: resource.h:14
static void AppearancePage_ShowSizes(HWND hwndDlg, GLOBALS *g)
Definition: appearance.c:81
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define CBN_SELCHANGE
Definition: winuser.h:1940
GLOBAL_DATA g_GlobalData
Definition: background.c:84
#define HIWORD(l)
Definition: typedefs.h:246
#define IDC_APPEARANCE_EFFECTS
Definition: resource.h:89
#define IDD_EFFAPPEARANCE
Definition: resource.h:15
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
struct _THEME * PTHEME
#define WM_NOTIFY
Definition: richedit.h:61

◆ BackgroundPageProc()

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

Definition at line 1157 of file background.c.

1161 {
1163  struct GdiplusStartupInput gdipStartup;
1164 
1166 
1167  switch (uMsg)
1168  {
1169  case WM_INITDIALOG:
1172  gdipStartup.GdiplusVersion = 1;
1173  gdipStartup.DebugEventCallback = NULL;
1174  gdipStartup.SuppressBackgroundThread = FALSE;
1175  gdipStartup.SuppressExternalCodecs = FALSE;
1176  GdiplusStartup(&pData->gdipToken, &gdipStartup, NULL);
1177  InitBackgroundDialog(hwndDlg, pData);
1178  break;
1179 
1180  case WM_COMMAND:
1181  {
1182  DWORD controlId = LOWORD(wParam);
1184 
1185  switch (controlId)
1186  {
1187  case IDC_COLOR_BUTTON:
1188  if (command == BN_CLICKED)
1189  OnColorButton(hwndDlg, pData);
1190  break;
1191 
1192  case IDC_BROWSE_BUTTON:
1193  if (command == BN_CLICKED)
1194  OnBrowseButton(hwndDlg, pData);
1195  break;
1196 
1197  case IDC_PLACEMENT_COMBO:
1198  if (command == CBN_SELCHANGE)
1199  {
1200  pData->placementSelection = (int)SendDlgItemMessage(hwndDlg, IDC_PLACEMENT_COMBO, CB_GETCURSEL, 0, 0);
1201 
1203 
1204  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1205  }
1206  break;
1207  }
1208  } break;
1209 
1210  case WM_DRAWITEM:
1211  {
1212  LPDRAWITEMSTRUCT drawItem;
1213  drawItem = (LPDRAWITEMSTRUCT)lParam;
1214 
1215  if (drawItem->CtlID == IDC_BACKGROUND_PREVIEW)
1216  {
1217  DrawBackgroundPreview(drawItem, pData);
1218  }
1219 
1220  }
1221  break;
1222 
1223  case WM_NOTIFY:
1224  {
1225  LPNMHDR lpnm = (LPNMHDR)lParam;
1226 
1227  switch(lpnm->code)
1228  {
1229  case PSN_APPLY:
1230  if (pData->bWallpaperChanged)
1232  if (pData->bClrBackgroundChanged)
1233  SetDesktopBackColor(hwndDlg, pData);
1235  return TRUE;
1236 
1237  case LVN_ITEMCHANGED:
1238  {
1240 
1241  if ((nm->uNewState & LVIS_SELECTED) == 0)
1242  return FALSE;
1243 
1244  ListViewItemChanged(hwndDlg, pData, nm->iItem);
1245  }
1246  break;
1247  }
1248  }
1249  break;
1250 
1251  case WM_DESTROY:
1252  if (pData->pWallpaperBitmap != NULL)
1253  DibFreeImage(pData->pWallpaperBitmap);
1254 
1255  DeleteObject(pData->hBitmap);
1256  GdiplusShutdown(pData->gdipToken);
1257  HeapFree(GetProcessHeap(), 0, pData);
1258  break;
1259  }
1260 
1261  return FALSE;
1262 }
#define IDC_BACKGROUND_PREVIEW
Definition: resource.h:22
#define IDC_BROWSE_BUTTON
Definition: resource.h:23
#define TRUE
Definition: types.h:120
static VOID SetWallpaper(PBACKGROUND_DATA pData)
Definition: background.c:1000
VOID DibFreeImage(PDIBITMAP lpBitmap)
Definition: dibitmap.c:90
UINT uNewState
Definition: commctrl.h:3008
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
struct _BACKGROUND_DATA * PBACKGROUND_DATA
#define LVN_ITEMCHANGED
Definition: commctrl.h:3103
struct _BACKGROUND_DATA BACKGROUND_DATA
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define SendDlgItemMessage
Definition: winuser.h:5708
#define PSN_APPLY
Definition: prsht.h:117
#define SetWindowLongPtr
Definition: treelist.c:70
#define CB_GETCURSEL
Definition: winuser.h:1904
WPARAM wParam
Definition: combotst.c:138
struct tagNMHDR * LPNMHDR
#define WM_SETTINGCHANGE
Definition: winuser.h:1611
UINT code
Definition: winuser.h:3112
static VOID OnColorButton(HWND hwndDlg, PBACKGROUND_DATA pData)
Definition: background.c:541
smooth NULL
Definition: ftsmooth.c:416
#define LVIS_SELECTED
Definition: commctrl.h:2291
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_DESTROY
Definition: winuser.h:1591
#define IDC_COLOR_BUTTON
Definition: resource.h:24
#define _T(x)
Definition: vfdio.h:22
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
void WINAPI GdiplusShutdown(ULONG_PTR)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput *input, struct GdiplusStartupOutput *output)
Definition: gdiplus.c:81
#define BN_CLICKED
Definition: winuser.h:1886
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DWLP_USER
Definition: winuser.h:866
static VOID ListViewItemChanged(HWND hwndDlg, PBACKGROUND_DATA pData, int itemIndex)
Definition: background.c:755
#define WM_COMMAND
Definition: winuser.h:1716
static VOID SetDesktopBackColor(HWND hwndDlg, PBACKGROUND_DATA pData)
Definition: background.c:1124
HWND WINAPI GetParent(_In_ HWND)
struct tagNMLISTVIEW * LPNMLISTVIEW
static VOID InitBackgroundDialog(HWND hwndDlg, PBACKGROUND_DATA pData)
Definition: background.c:457
static VOID OnBrowseButton(HWND hwndDlg, PBACKGROUND_DATA pData)
Definition: background.c:625
static VOID DrawBackgroundPreview(LPDRAWITEMSTRUCT draw, PBACKGROUND_DATA pData)
Definition: background.c:789
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define CBN_SELCHANGE
Definition: winuser.h:1940
#define WM_DRAWITEM
Definition: winuser.h:1627
#define SendMessage
Definition: winuser.h:5709
#define IDC_PLACEMENT_COMBO
Definition: resource.h:25
#define HIWORD(l)
Definition: typedefs.h:246
#define GetWindowLongPtr
Definition: treelist.c:73
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define HWND_BROADCAST
Definition: winuser.h:1190
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
#define WM_NOTIFY
Definition: richedit.h:61
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

◆ CPlApplet()

LONG CALLBACK CPlApplet ( HWND  hwndCPl,
UINT  uMsg,
LPARAM  lParam1,
LPARAM  lParam2 
)

Definition at line 248 of file desk.c.

249 {
250  int i = (int)lParam1;
251 
252  switch (uMsg)
253  {
254  case CPL_INIT:
255  return TRUE;
256 
257  case CPL_GETCOUNT:
258  return NUM_APPLETS;
259 
260  case CPL_INQUIRE:
261  {
262  CPLINFO *CPlInfo = (CPLINFO*)lParam2;
263  CPlInfo->lData = 0;
264  CPlInfo->idIcon = Applets[i].idIcon;
265  CPlInfo->idName = Applets[i].idName;
266  CPlInfo->idInfo = Applets[i].idDescription;
267  }
268  break;
269 
270  case CPL_DBLCLK:
271  Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
272  break;
273  case CPL_STARTWPARMSW:
274  return Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
275  }
276 
277  return FALSE;
278 }
#define TRUE
Definition: types.h:120
Definition: cpl.h:24
int idName
Definition: hotplug.h:27
int idIcon
Definition: hotplug.h:26
int idInfo
Definition: cpl.h:27
int idIcon
Definition: cpl.h:25
int idDescription
Definition: hotplug.h:28
#define CPL_DBLCLK
Definition: cpl.h:16
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
APPLET_PROC AppletProc
Definition: hotplug.h:29
#define CPL_STARTWPARMSW
Definition: cpl.h:21
#define CPL_INIT
Definition: cpl.h:12
APPLET Applets[NUM_APPLETS]
Definition: desk.c:29
#define CPL_INQUIRE
Definition: cpl.h:14
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
#define NUM_APPLETS
Definition: desk.c:15
#define CPL_GETCOUNT
Definition: cpl.h:13
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

◆ DisplayApplet()

static LONG APIENTRY DisplayApplet ( HWND  hwnd,
UINT  uMsg,
LPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 140 of file desk.c.

141 {
143  PROPSHEETHEADER psh;
144  HPSXA hpsxa = NULL;
145  TCHAR Caption[1024];
146  UINT i;
147  LPWSTR *argv = NULL;
148  LPCWSTR pwszSelectedTab = NULL;
149  LPCWSTR pwszFile = NULL;
150  LPCWSTR pwszAction = NULL;
151 
153 
154  hCPLWindow = hwnd;
155 
156  if (uMsg == CPL_STARTWPARMSW && lParam)
157  {
158  int argc;
159  int i;
160 
161 #if 0
163 #else
165 #endif
166 
167  if (argv && argc)
168  {
169  for (i = 0; i<argc; i++)
170  {
171 #if 0
172  if (argv[i][0] == L'@')
173  pwszSelectedTab = &argv[i][1];
174 #else
175  if (wcsncmp(argv[i], L"desk,@", 6) == 0)
176  pwszSelectedTab = &argv[i][6];
177 #endif
178  else if (wcsncmp(argv[i], L"/Action:", 8) == 0)
179  pwszAction = &argv[i][8];
180  else if (wcsncmp(argv[i], L"/file:", 6) == 0)
181  pwszFile = &argv[i][6];
182  }
183  }
184  }
185 
186  if(pwszAction && wcsncmp(pwszAction, L"ActivateMSTheme", 15) == 0)
187  {
188  ActivateThemeFile(pwszFile);
189  goto cleanup;
190  }
191 
192  g_GlobalData.pwszFile = pwszFile;
193  g_GlobalData.pwszAction = pwszAction;
195 
196  LoadString(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
197 
198  ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
199  psh.dwSize = sizeof(PROPSHEETHEADER);
200  psh.dwFlags = PSH_USECALLBACK | PSH_PROPTITLE | PSH_USEICONID;
201  psh.hwndParent = hCPLWindow;
202  psh.hInstance = hApplet;
203  psh.pszIcon = MAKEINTRESOURCEW(IDC_DESK_ICON);
204  psh.pszCaption = Caption;
205  psh.nPages = 0;
206  psh.nStartPage = 0;
207  psh.phpage = hpsp;
208  psh.pfnCallback = PropSheetProc;
209 
210  /* Allow shell extensions to replace the background page */
212 
213  for (i = 0; i != sizeof(PropPages) / sizeof(PropPages[0]); i++)
214  {
215  if (pwszSelectedTab && wcsicmp(pwszSelectedTab, PropPages[i].Name) == 0)
216  psh.nStartPage = i;
217 
218  /* Override the background page if requested by a shell extension */
219  if (PropPages[i].idDlg == IDD_BACKGROUND && hpsxa != NULL &&
221  {
222  /* The shell extension added one or more pages to replace the background page.
223  Don't create the built-in page anymore! */
224  continue;
225  }
226 
228  }
229 
230  /* NOTE: Don't call SHAddFromPropSheetExtArray here because this applet only allows
231  replacing the background page but not extending the applet by more pages */
232 
233  PropertySheet(&psh);
234 
235 cleanup:
236  if (hpsxa != NULL)
238 
239  if (argv)
240  LocalFree(argv);
241 
242  return TRUE;
243 }
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:1755
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static int argc
Definition: ServiceArgs.c:12
WORD idDlg
Definition: desk.c:109
#define TRUE
Definition: types.h:120
HWND hCPLWindow
Definition: desk.c:26
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define MAX_DESK_PAGES
Definition: desk.h:66
BOOL ActivateThemeFile(LPCWSTR pwszFile)
Definition: theme.c:1014
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
COLORREF desktop_color
Definition: desk.h:106
#define REGSTR_PATH_CONTROLSFOLDER
Definition: regstr.h:76
#define ZeroMemory
Definition: winbase.h:1635
LPCWSTR pwszAction
Definition: desk.h:108
#define COLOR_DESKTOP
Definition: winuser.h:904
static BOOL CALLBACK DisplayAppletPropSheetAddPage(HPROPSHEETPAGE hpage, LPARAM lParam)
Definition: desk.c:67
static BOOL InitPropSheetPage(PROPSHEETHEADER *ppsh, WORD idDlg, DLGPROC DlgProc, LPFNPSPCALLBACK pfnCallback)
Definition: desk.c:80
#define PSH_USECALLBACK
Definition: prsht.h:48
#define IDD_BACKGROUND
Definition: resource.h:10
#define argv
Definition: mplay32.c:18
DWORD WINAPI GetSysColor(_In_ int)
WPARAM wParam
Definition: combotst.c:138
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 IDS_CPLNAME
Definition: resource.h:8
#define PSH_USEICONID
Definition: prsht.h:42
LPWSTR WINAPI GetCommandLineW(VOID)
Definition: proc.c:2043
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
LPWSTR *WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int *numargs)
Definition: shell32_main.c:76
smooth NULL
Definition: ftsmooth.c:416
#define PROPSHEETHEADER
Definition: prsht.h:374
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: desk.c:122
LONG_PTR LPARAM
Definition: windef.h:208
LPCWSTR pwszFile
Definition: desk.h:107
#define IDC_DESK_ICON
Definition: resource.h:4
char TCHAR
Definition: xmlstorage.h:189
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define PSH_PROPTITLE
Definition: prsht.h:40
HINSTANCE hApplet
Definition: desk.c:25
#define CPL_STARTWPARMSW
Definition: cpl.h:21
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
static const WCHAR L[]
Definition: oid.c:1250
#define wcsicmp
Definition: string.h:1152
#define TEXT(s)
Definition: k32.h:26
#define CPLPAGE_DISPLAY_BACKGROUND
Definition: cplext.h:8
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
unsigned int UINT
Definition: ndis.h:50
UINT WINAPI SHReplaceFromPropSheetExtArray(HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam)
Definition: shellord.c:1724
static const struct @202 PropPages[]
#define PropertySheet
Definition: prsht.h:382
GLOBAL_DATA g_GlobalData
Definition: background.c:84
char * cleanup(char *str)
Definition: wpickclick.c:99
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HPSXA WINAPI SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface)
Definition: shellord.c:1607
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPFNPSPCALLBACK Callback
Definition: desk.c:111
LPARAM lParam
Definition: combotst.c:139
DLGPROC DlgProc
Definition: desk.c:110
#define LoadString
Definition: winuser.h:5685
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

◆ DisplayAppletPropSheetAddPage()

static BOOL CALLBACK DisplayAppletPropSheetAddPage ( HPROPSHEETPAGE  hpage,
LPARAM  lParam 
)
static

Definition at line 67 of file desk.c.

68 {
70  if (ppsh != NULL && ppsh->nPages < MAX_DESK_PAGES)
71  {
72  ppsh->phpage[ppsh->nPages++] = hpage;
73  return TRUE;
74  }
75 
76  return FALSE;
77 }
#define TRUE
Definition: types.h:120
#define MAX_DESK_PAGES
Definition: desk.h:66
smooth NULL
Definition: ftsmooth.c:416
#define PROPSHEETHEADER
Definition: prsht.h:374
LPARAM lParam
Definition: combotst.c:139

Referenced by DisplayApplet(), and InitPropSheetPage().

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInstDLL,
DWORD  dwReason,
LPVOID  lpvReserved 
)

Definition at line 358 of file desk.c.

359 {
361 
362  switch (dwReason)
363  {
364  case DLL_PROCESS_ATTACH:
366  RegisterPreviewControl(hInstDLL);
367 // case DLL_THREAD_ATTACH:
368  hApplet = hInstDLL;
369  break;
370 
371  case DLL_PROCESS_DETACH:
372  UnregisterPreviewControl(hInstDLL);
373  CoUninitialize();
374  break;
375  }
376 
377  return TRUE;
378 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
static IN DWORD IN LPVOID lpvReserved
DWORD dwReason
Definition: misc.cpp:154
smooth NULL
Definition: ftsmooth.c:416
VOID UnregisterPreviewControl(IN HINSTANCE hInstance)
Definition: preview.c:555
#define DLL_PROCESS_DETACH
Definition: compat.h:119
HINSTANCE hApplet
Definition: desk.c:25
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1991
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:1935
BOOL RegisterPreviewControl(IN HINSTANCE hInstance)
Definition: preview.c:539

◆ InitPropSheetPage()

static BOOL InitPropSheetPage ( PROPSHEETHEADER ppsh,
WORD  idDlg,
DLGPROC  DlgProc,
LPFNPSPCALLBACK  pfnCallback 
)
static

Definition at line 80 of file desk.c.

81 {
82  HPROPSHEETPAGE hPage;
83  PROPSHEETPAGE psp;
84 
85  if (ppsh->nPages < MAX_DESK_PAGES)
86  {
87  ZeroMemory(&psp, sizeof(psp));
88  psp.dwSize = sizeof(psp);
89  psp.dwFlags = PSP_DEFAULT;
90  if (pfnCallback != NULL)
91  psp.dwFlags |= PSP_USECALLBACK;
92  psp.hInstance = hApplet;
93  psp.pszTemplate = MAKEINTRESOURCE(idDlg);
94  psp.pfnDlgProc = DlgProc;
95  psp.pfnCallback = pfnCallback;
96 
97  hPage = CreatePropertySheetPage(&psp);
98  if (hPage != NULL)
99  {
100  return DisplayAppletPropSheetAddPage(hPage, (LPARAM)ppsh);
101  }
102  }
103 
104  return FALSE;
105 }
WORD idDlg
Definition: desk.c:109
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define MAX_DESK_PAGES
Definition: desk.h:66
#define ZeroMemory
Definition: winbase.h:1635
#define PSP_USECALLBACK
Definition: prsht.h:30
static BOOL CALLBACK DisplayAppletPropSheetAddPage(HPROPSHEETPAGE hpage, LPARAM lParam)
Definition: desk.c:67
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define CreatePropertySheetPage
Definition: prsht.h:381
#define PSP_DEFAULT
Definition: prsht.h:22
HINSTANCE hApplet
Definition: desk.c:25
DLGPROC DlgProc
Definition: desk.c:110
#define PROPSHEETPAGE
Definition: prsht.h:371

Referenced by DisplayApplet().

◆ InstallScreenSaverA()

void WINAPI InstallScreenSaverA ( IN HWND  hWindow,
IN HANDLE  hInstance,
IN LPCSTR  pszFile,
IN UINT  nCmdShow 
)

Definition at line 331 of file desk.c.

336 {
337  LPWSTR lpwString;
338 
339  if (!pszFile)
340  {
341  DPRINT("InstallScreenSaver() null file\n");
343  return;
344  }
345  DPRINT("InstallScreenSaver() Install from file %s\n", pszFile);
346  lpwString = pSetupMultiByteToUnicode(pszFile, 0);
347  if (!lpwString)
348  {
349  DPRINT("InstallScreenSaver() not enough memory to convert string to unicode\n");
351  return;
352  }
353  InstallScreenSaverW(hWindow, hInstance, lpwString, nCmdShow);
354  MyFree(lpwString);
355 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
HINSTANCE hInstance
Definition: charmap.c:20
LPWSTR WINAPI pSetupMultiByteToUnicode(LPCSTR lpMultiByteStr, UINT uCodePage)
Definition: misc.c:281
void DPRINT(...)
Definition: polytest.cpp:61
void WINAPI InstallScreenSaverW(IN HWND hWindow, IN HANDLE hInstance, IN LPCWSTR pszFile, IN UINT nCmdShow)
Definition: desk.c:282
#define SetLastError(x)
Definition: compat.h:409
WCHAR * LPWSTR
Definition: xmlstorage.h:184
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128

◆ InstallScreenSaverW()

void WINAPI InstallScreenSaverW ( IN HWND  hWindow,
IN HANDLE  hInstance,
IN LPCWSTR  pszFile,
IN UINT  nCmdShow 
)

Definition at line 282 of file desk.c.

287 {
288  WCHAR pszSystemDir[MAX_PATH];
289  WCHAR pszDrive[3];
290  WCHAR pszPath[MAX_PATH];
291  WCHAR pszFilename[MAX_PATH];
292  WCHAR pszExt[MAX_PATH];
293  LPWSTR pszOutName;
294  UINT uCompressionType=FILE_COMPRESSION_NONE;
295  DWORD dwSourceSize;
296  DWORD dwTargetSize;
297  DWORD rc;
298 
299  if (!pszFile)
300  {
301  DPRINT("InstallScreenSaver() null file\n");
303  return;
304  }
305  DPRINT("InstallScreenSaver() Installing screensaver %ls\n", pszFile);
306 
307  rc = SetupGetFileCompressionInfoW(pszFile, &pszOutName, &dwSourceSize, &dwTargetSize, &uCompressionType);
308  if (ERROR_SUCCESS != rc)
309  {
310  DPRINT("InstallScreenSaver() SetupGetFileCompressionInfo failed with error 0x%lx\n", rc);
311  SetLastError(rc);
312  return;
313  }
314  if (!GetSystemDirectoryW((LPWSTR)pszSystemDir, sizeof(pszSystemDir)/sizeof(WCHAR)))
315  {
316  MyFree(pszOutName);
317  DPRINT("InstallScreenSaver() GetSystemDirectory failed with error 0x%lx\n", GetLastError());
318  return;
319  }
320  _wsplitpath(pszOutName, pszDrive, pszPath, pszFilename, pszExt);
321  MyFree(pszOutName);
322  StringCbCatW(pszSystemDir, sizeof(pszSystemDir), L"\\");
323  StringCbCatW(pszSystemDir, sizeof(pszSystemDir), pszFilename);
324  StringCbCatW(pszSystemDir, sizeof(pszSystemDir), pszExt);
325  rc = SetupDecompressOrCopyFileW(pszFile, pszSystemDir, &uCompressionType);
326  DPRINT("InstallScreenSaver() Copying to %ls, compression type %d return 0x%lx\n", pszFile, uCompressionType, rc);
327 }
void _wsplitpath(const WCHAR *path, WCHAR *drv, WCHAR *dir, WCHAR *name, WCHAR *ext)
Definition: splitpath.c:22
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FILE_COMPRESSION_NONE
Definition: setupapi.h:351
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
void DPRINT(...)
Definition: polytest.cpp:61
DWORD WINAPI SetupDecompressOrCopyFileW(PCWSTR source, PCWSTR target, PUINT type)
Definition: misc.c:1690
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
DWORD WINAPI SetupGetFileCompressionInfoW(PCWSTR source, PWSTR *name, PDWORD source_size, PDWORD target_size, PUINT type)
Definition: misc.c:1555
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
static const WCHAR L[]
Definition: oid.c:1250
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2312
unsigned int UINT
Definition: ndis.h:50
WCHAR * LPWSTR
Definition: xmlstorage.h:184
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128

Referenced by InstallScreenSaverA().

◆ LoadPopupMenu()

HMENU LoadPopupMenu ( IN HINSTANCE  hInstance,
IN LPCTSTR  lpMenuName 
)

Definition at line 40 of file desk.c.

42 {
43  HMENU hMenu, hSubMenu = NULL;
44 
45  hMenu = LoadMenu(hInstance,
46  lpMenuName);
47 
48  if (hMenu != NULL)
49  {
50  hSubMenu = GetSubMenu(hMenu,
51  0);
52  if (hSubMenu != NULL &&
53  !RemoveMenu(hMenu,
54  0,
56  {
57  hSubMenu = NULL;
58  }
59 
60  DestroyMenu(hMenu);
61  }
62 
63  return hSubMenu;
64 }
HINSTANCE hInstance
Definition: charmap.c:20
#define MF_BYPOSITION
Definition: winuser.h:203
smooth NULL
Definition: ftsmooth.c:416
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define LoadMenu
Definition: winuser.h:5683
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

◆ PropSheetProc()

static int CALLBACK PropSheetProc ( HWND  hwndDlg,
UINT  uMsg,
LPARAM  lParam 
)
static

Definition at line 122 of file desk.c.

123 {
124  // NOTE: This callback is needed to set large icon correctly.
125  HICON hIcon;
126  switch (uMsg)
127  {
128  case PSCB_INITIALIZED:
129  {
131  SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
132  break;
133  }
134  }
135  return 0;
136 }
static HICON
Definition: imagelist.c:84
LONG_PTR LPARAM
Definition: windef.h:208
#define IDC_DESK_ICON
Definition: resource.h:4
HINSTANCE hApplet
Definition: desk.c:25
#define PSCB_INITIALIZED
Definition: prsht.h:75
HICON hIcon
Definition: msconfig.c:44
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define ICON_BIG
Definition: tnclass.cpp:51

Referenced by DisplayApplet().

◆ ScreenSaverPageProc()

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

Definition at line 692 of file screensaver.c.

696 {
697  PDATA pData;
698 
699  pData = (PDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
700 
701  switch (uMsg)
702  {
703  case WM_INITDIALOG:
704  {
705  OnInitDialog(hwndDlg, pData);
706  break;
707  }
708 
709  case WM_DESTROY:
710  {
711  if (pData->PrevWindowPi.hProcess)
712  {
713  TerminateProcess(pData->PrevWindowPi.hProcess, 0);
714  CloseHandle(pData->PrevWindowPi.hProcess);
715  CloseHandle(pData->PrevWindowPi.hThread);
716  }
718  0,
719  pData);
720  break;
721  }
722 
723  case WM_ENDSESSION:
724  {
725  SetScreenSaverPreviewBox(hwndDlg,
726  pData);
727  break;
728  }
729 
730  case WM_COMMAND:
731  {
732  DWORD controlId = LOWORD(wParam);
734 
735  switch (controlId)
736  {
737  case IDC_SCREENS_LIST:
738  {
739  if (HIWORD(wParam) == CBN_SELCHANGE)
740  {
741  SelectionChanged(hwndDlg, pData);
743  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
744  }
745  break;
746  }
747 
749  {
750  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
751  break;
752  }
753 
754  case IDC_SCREENS_POWER_BUTTON: // Start Powercfg.Cpl
755  {
756  if (command == BN_CLICKED)
757  WinExec("rundll32 shell32.dll,Control_RunDLL powercfg.cpl",SW_SHOWNORMAL);
758  break;
759  }
760 
761  case IDC_SCREENS_TESTSC: // Screensaver Preview
762  {
763  if (command == BN_CLICKED)
764  {
765  ScreensaverPreview(hwndDlg, pData);
767  }
768  break;
769  }
770 
771  case IDC_SCREENS_SETTINGS: // Screensaver Settings
772  {
773  if (command == BN_CLICKED)
774  ScreensaverConfig(hwndDlg, pData);
775  break;
776  }
777 
778  case IDC_SCREENS_USEPASSCHK: // Screensaver Is Secure
779  {
780  if (command == BN_CLICKED)
781  {
782  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
783  }
784  break;
785  }
786  }
787  break;
788  }
789 
790  case WM_NOTIFY:
791  {
792  LPNMHDR lpnm = (LPNMHDR)lParam;
793 
794  switch(lpnm->code)
795  {
796  case PSN_APPLY:
797  {
798  SetScreenSaver(hwndDlg, pData);
799  return TRUE;
800  }
801 
802  case PSN_SETACTIVE:
803  {
804  /* Enable screensaver preview support */
806  break;
807  }
808 
809  case PSN_KILLACTIVE:
810  {
811  /* Kill running preview screensaver */
812  if (pData->PrevWindowPi.hProcess)
813  {
814  TerminateProcess(pData->PrevWindowPi.hProcess, 0);
815  CloseHandle(pData->PrevWindowPi.hProcess);
816  CloseHandle(pData->PrevWindowPi.hThread);
817  pData->PrevWindowPi.hThread = pData->PrevWindowPi.hProcess = NULL;
818  }
819  break;
820  }
821  }
822  }
823  break;
824  }
825 
826  return FALSE;
827 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
#define IDC_SCREENS_SETTINGS
Definition: resource.h:32
#define IDC_SCREENS_POWER_BUTTON
Definition: resource.h:31
#define IDC_SCREENS_LIST
Definition: resource.h:30
#define IDC_SCREENS_TIMEDELAY
Definition: resource.h:35
#define IDC_SCREENS_USEPASSCHK
Definition: resource.h:34
static BOOL OnInitDialog(HWND hwndDlg, PDATA pData)
Definition: screensaver.c:582
UINT WINAPI DECLSPEC_HOTPATCH WinExec(LPCSTR lpCmdLine, UINT uCmdShow)
Definition: proc.c:4804
static VOID SetScreenSaver(HWND hwndDlg, PDATA pData)
Definition: screensaver.c:510
#define PSN_APPLY
Definition: prsht.h:117
#define PSN_SETACTIVE
Definition: prsht.h:115
WPARAM wParam
Definition: combotst.c:138
struct tagNMHDR * LPNMHDR
static VOID SetScreenSaverPreviewBox(HWND hwndDlg, PDATA pData)
Definition: screensaver.c:108
UINT code
Definition: winuser.h:3112
#define PSN_KILLACTIVE
Definition: prsht.h:116
smooth NULL
Definition: ftsmooth.c:416
struct _DATA * PDATA
#define WM_DESTROY
Definition: winuser.h:1591
#define GetProcessHeap()
Definition: compat.h:395
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define BN_CLICKED
Definition: winuser.h:1886
unsigned long DWORD
Definition: ntddk_ex.h:95
static VOID ScreensaverPreview(HWND hwndDlg, PDATA pData)
Definition: screensaver.c:244
#define WM_ENDSESSION
Definition: winuser.h:1609
static VOID ScreensaverConfig(HWND hwndDlg, PDATA pData)
Definition: screensaver.c:196
#define DWLP_USER
Definition: winuser.h:866
#define IDC_SCREENS_TESTSC
Definition: resource.h:33
static VOID SelectionChanged(HWND hwndDlg, PDATA pData)
Definition: screensaver.c:82
#define WM_COMMAND
Definition: winuser.h:1716
HWND WINAPI GetParent(_In_ HWND)
#define SW_SHOWNORMAL
Definition: winuser.h:764
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1562
#define CBN_SELCHANGE
Definition: winuser.h:1940
#define HIWORD(l)
Definition: typedefs.h:246
#define GetWindowLongPtr
Definition: treelist.c:73
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
#define WM_NOTIFY
Definition: richedit.h:61

◆ SettingsPageCallbackProc()

UINT CALLBACK SettingsPageCallbackProc ( HWND  hwnd,
UINT  uMsg,
LPPROPSHEETPAGE  ppsp 
)

Definition at line 643 of file settings.c.

644 {
645  UINT Ret = 0;
646 
647  switch (uMsg)
648  {
649  case PSPCB_CREATE:
651  break;
652 
653  case PSPCB_RELEASE:
655  break;
656  }
657 
658  return Ret;
659 }
HINSTANCE hApplet
Definition: access.c:17
VOID UnregisterMonitorSelectionControl(IN HINSTANCE hInstance)
Definition: monslctl.c:1655
#define PSPCB_RELEASE
Definition: prsht.h:37
#define PSPCB_CREATE
Definition: prsht.h:38
unsigned int UINT
Definition: ndis.h:50
BOOL RegisterMonitorSelectionControl(IN HINSTANCE hInstance)
Definition: monslctl.c:1638

◆ SettingsPageProc()

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

Definition at line 456 of file settings_page.c.

457 {
458  switch (uMsg)
459  {
460  case WM_INITDIALOG:
461  OnInitSettingsPage(hwndDlg);
462  break;
463 
464  case WM_DESTROY:
465  OnDestroySettingsPage(hwndDlg);
466  break;
467 
468  case WM_COMMAND:
469  OnCommandSettingsPage(hwndDlg, wParam);
470  break;
471 
472  case WM_NOTIFY:
473  OnNotifySettingsPage(hwndDlg, lParam);
474  break;
475  }
476 
477  return FALSE;
478 }
VOID OnCommandSettingsPage(HWND hwndDlg, WPARAM wParam)
WPARAM wParam
Definition: combotst.c:138
#define WM_DESTROY
Definition: winuser.h:1591
static VOID OnNotifySettingsPage(HWND hwndDlg, LPARAM lParam)
static VOID OnDestroySettingsPage(HWND hwndDlg)
#define WM_COMMAND
Definition: winuser.h:1716
static VOID OnInitSettingsPage(HWND hwndDlg)
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by SystemApplet().

Variable Documentation

◆ Applets

APPLET Applets[NUM_APPLETS]
Initial value:
=
{
{
}
}
#define IDS_CPLNAME
Definition: resource.h:8
#define IDC_DESK_ICON
Definition: resource.h:4
#define IDS_CPLDESCRIPTION
Definition: resource.h:9
static LONG APIENTRY DisplayApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
Definition: desk.c:140

Definition at line 29 of file desk.c.

Referenced by CPlApplet().

◆ Callback

Definition at line 111 of file desk.c.

Referenced by BlTblFindEntry(), BlTblSetEntry(), Chkdsk(), ChkdskEx(), ChkdskFileSystem(), ChkdskFileSystem_UStr(), CmRegisterCallback(), CreateHardwareTimer(), CreateTimerQueueTimer(), CTEStartTimer(), ddraw7_EnumSurfaces(), DisplayApplet(), DosMouseService(), EnumerateSectionsStartingWith(), EnumerateSoundDevices(), EnumerateSubkey(), ExCreateCallback(), ExDoCallBack(), ExInitializeCallBack(), Ext2Format(), FindDebugInfoFileEx(), FindExecutableImageEx(), FindExecutableImageExW(), Format(), FormatEx(), FormatEx2(), FormatFileSystem(), FormatFileSystem_UStr(), HDA_TransferCodecVerbs(), InbvNotifyDisplayOwnershipLost(), IoReportTargetDeviceChangeAsynchronous(), KdbRegisterCliCallback(), KdRosSetDebugCallback(), KmtFilterRegisterContexts(), KspEnumerateBusRegistryKeys(), KsStreamPointerScheduleTimeout(), LdrpCallTlsInitializers(), LdrVerifyImageMatchesChecksum(), LpcRequestWaitReplyPort(), NtRequestWaitReplyPort(), PsaEnumerateProcesses(), PsaEnumerateProcessModules(), PsaEnumerateSystemModules(), PsaEnumerateThreads(), PsaWalkProcesses(), PsaWalkSystemModules(), PsaWalkThreads(), RegisterWaitForSingleObject(), RegisterWaitForSingleObjectEx(), RtlCreateTimer(), RtlIsRangeAvailable(), RtlRegisterWait(), RtlSetIoCompletionCallback(), DriveVolume::ScanDirectory(), SetTimerQueueTimer(), TestObjectTypes(), USBPORT_RequestAsyncCallback(), VfatChkdsk(), VfatFormat(), VfatxFormat(), WahEnumerateHandleContexts(), WPUQueryBlockingCallback(), WsNcEnumerateCatalogItems(), and WsTcEnumerateCatalogItems().

◆ DlgProc

◆ hApplet

HINSTANCE hApplet = 0

Definition at line 25 of file desk.c.

Referenced by DisplayApplet(), DllMain(), InitPropSheetPage(), and PropSheetProc().

◆ hCPLWindow

HWND hCPLWindow

Definition at line 26 of file desk.c.

Referenced by DisplayApplet().

◆ idDlg

◆ Name

Definition at line 112 of file desk.c.

◆ PropPages

const { ... } PropPages[]
Initial value:
=
{
{ IDD_SCREENSAVER, ScreenSaverPageProc, NULL, L"Screen Saver" },
}
INT_PTR CALLBACK ScreenSaverPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: screensaver.c:692
UINT CALLBACK SettingsPageCallbackProc(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
Definition: settings.c:643
#define IDD_SETTINGS
Definition: resource.h:13
#define IDD_APPEARANCE
Definition: resource.h:12
#define IDD_BACKGROUND
Definition: resource.h:10
#define IDD_SCREENSAVER
Definition: resource.h:11
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR L[]
Definition: oid.c:1250
INT_PTR CALLBACK BackgroundPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: background.c:1157
INT_PTR CALLBACK SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: appearance.c:216

Referenced by DisplayApplet().