ReactOS  0.4.14-dev-50-g13bb5e2
TaskbarSettings Struct Reference

#include <precomp.h>

Collaboration diagram for TaskbarSettings:

Public Member Functions

BOOL Load ()
 
BOOL Save ()
 

Public Attributes

BOOL bLock
 
BOOL bGroupButtons
 
BOOL bShowSeconds
 
BOOL bHideInactiveIcons
 
TW_STRUCKRECTS2 sr
 

Detailed Description

Definition at line 203 of file precomp.h.

Member Function Documentation

◆ Load()

BOOL TaskbarSettings::Load ( )

Definition at line 39 of file settings.cpp.

40 {
41  DWORD dwRet, cbSize, dwValue = NULL;
42 
43  cbSize = sizeof(dwValue);
44  dwRet = SHGetValueW(hkExplorer, L"Advanced", L"TaskbarSizeMove", NULL, &dwValue, &cbSize);
45  bLock = (dwRet == ERROR_SUCCESS) ? (dwValue == 0) : TRUE;
46 
47  dwRet = SHGetValueW(hkExplorer, L"Advanced", L"ShowSeconds", NULL, &dwValue, &cbSize);
48  bShowSeconds = (dwRet == ERROR_SUCCESS) ? (dwValue != 0) : FALSE;
49 
50  dwRet = SHGetValueW(hkExplorer, L"Advanced", L"TaskbarGlomming", NULL, &dwValue, &cbSize);
51  bGroupButtons = (dwRet == ERROR_SUCCESS) ? (dwValue != 0) : FALSE;
52 
53  dwRet = SHGetValueW(hkExplorer, NULL, L"EnableAutotray", NULL, &dwValue, &cbSize);
54  bHideInactiveIcons = (dwRet == ERROR_SUCCESS) ? (dwValue != 0) : FALSE;
55 
56  cbSize = sizeof(sr);
57  dwRet = SHGetValueW(hkExplorer, L"StuckRects2", L"Settings", NULL, &sr, &cbSize);
58 
59  /* Make sure we have correct values here */
60  if (dwRet != ERROR_SUCCESS || sr.cbSize != sizeof(sr) || cbSize != sizeof(sr))
61  {
63  sr.AutoHide = FALSE;
65  sr.SmallIcons = TRUE;
66  sr.HideClock = FALSE;
67  sr.Rect.left = sr.Rect.top = 0;
68  sr.Rect.bottom = sr.Rect.right = 1;
69  sr.Size.cx = sr.Size.cy = 0;
70  }
71  else
72  {
73  if (sr.Position > ABE_BOTTOM)
75  }
76 
77  return TRUE;
78 }
#define TRUE
Definition: types.h:120
DWORD HideClock
Definition: precomp.h:195
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
BOOL bShowSeconds
Definition: precomp.h:207
LONG right
Definition: windef.h:293
TW_STRUCKRECTS2 sr
Definition: precomp.h:209
DWORD Position
Definition: precomp.h:198
HKEY hkExplorer
Definition: explorer.cpp:26
DWORD SmallIcons
Definition: precomp.h:194
DWORD AutoHide
Definition: precomp.h:192
smooth NULL
Definition: ftsmooth.c:416
LONG cx
Definition: windef.h:319
DWORD AlwaysOnTop
Definition: precomp.h:193
BOOL bHideInactiveIcons
Definition: precomp.h:208
BOOL bGroupButtons
Definition: precomp.h:206
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1236
#define ABE_BOTTOM
Definition: shellapi.h:20
DWORD cbSize
Definition: precomp.h:185
LONG bottom
Definition: windef.h:294
LONG cy
Definition: windef.h:320

Referenced by StartWithDesktop().

◆ Save()

BOOL TaskbarSettings::Save ( )

Definition at line 25 of file settings.cpp.

26 {
28  SHSetValueW(hkExplorer, L"Advanced", L"ShowSeconds", REG_DWORD, &bShowSeconds, sizeof(bShowSeconds));
29  SHSetValueW(hkExplorer, L"Advanced", L"TaskbarGlomming", REG_DWORD, &bGroupButtons, sizeof(bGroupButtons));
30  BOOL bAllowSizeMove = !bLock;
31  SHSetValueW(hkExplorer, L"Advanced", L"TaskbarSizeMove", REG_DWORD, &bAllowSizeMove, sizeof(bAllowSizeMove));
32  sr.cbSize = sizeof(sr);
33  SHSetValueW(hkExplorer, L"StuckRects2", L"Settings", REG_BINARY, &sr, sizeof(sr));
34 
35  /* TODO: AutoHide writes something to HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\Components\0 figure out what and why */
36  return TRUE;
37 }
DWORD WINAPI SHSetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, DWORD dwType, LPCVOID pvData, DWORD cbData)
Definition: reg.c:1306
#define TRUE
Definition: types.h:120
#define REG_BINARY
Definition: nt_native.h:1496
BOOL bShowSeconds
Definition: precomp.h:207
TW_STRUCKRECTS2 sr
Definition: precomp.h:209
HKEY hkExplorer
Definition: explorer.cpp:26
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
BOOL bHideInactiveIcons
Definition: precomp.h:208
BOOL bGroupButtons
Definition: precomp.h:206
static const WCHAR L[]
Definition: oid.c:1250
DWORD cbSize
Definition: precomp.h:185
#define REG_DWORD
Definition: sdbapi.c:596

Referenced by CTrayWindow::OnTaskbarSettingsChanged().

Member Data Documentation

◆ bGroupButtons

◆ bHideInactiveIcons

BOOL TaskbarSettings::bHideInactiveIcons

◆ bLock

◆ bShowSeconds

◆ sr


The documentation for this struct was generated from the following files: