ReactOS 0.4.16-dev-1272-g2c12489
TaskbarSettings Struct Reference

#include <precomp.h>

Collaboration diagram for TaskbarSettings:

Public Member Functions

BOOL Load ()
 
BOOL Save ()
 
BOOL UseCompactTrayIcons ()
 

Public Attributes

BOOL bLock
 
BOOL bGroupButtons
 
BOOL bShowSeconds
 
BOOL bPreferDate
 
BOOL bHideInactiveIcons
 
BOOL bSmallIcons
 
TrayIconsMode eCompactTrayIcons
 
BOOL bShowDesktopButton
 
TW_STRUCKRECTS2 sr
 

Detailed Description

Definition at line 217 of file precomp.h.

Member Function Documentation

◆ Load()

BOOL TaskbarSettings::Load ( )

Definition at line 42 of file settings.cpp.

43{
44 DWORD dwRet, cbSize, dwValue = NULL;
45
46 cbSize = sizeof(dwValue);
47 dwRet = SHGetValueW(hkExplorer, L"Advanced", L"TaskbarSizeMove", NULL, &dwValue, &cbSize);
48 bLock = (dwRet == ERROR_SUCCESS) ? (dwValue == 0) : TRUE;
49
50 dwRet = SHGetValueW(hkExplorer, L"Advanced", L"PreferDateOverWeekday", NULL, &dwValue, &cbSize);
51 bPreferDate = (dwRet == ERROR_SUCCESS) ? (dwValue != 0) : FALSE; /* This is opt-in setting */
52
53 dwRet = SHGetValueW(hkExplorer, L"Advanced", L"ShowSeconds", NULL, &dwValue, &cbSize);
54 bShowSeconds = (dwRet == ERROR_SUCCESS) ? (dwValue != 0) : FALSE;
55
56 dwRet = SHGetValueW(hkExplorer, L"Advanced", L"TaskbarGlomming", NULL, &dwValue, &cbSize);
57 bGroupButtons = (dwRet == ERROR_SUCCESS) ? (dwValue != 0) : FALSE;
58
59 dwRet = SHGetValueW(hkExplorer, NULL, L"EnableAutotray", NULL, &dwValue, &cbSize);
60 bHideInactiveIcons = (dwRet == ERROR_SUCCESS) ? (dwValue != 0) : FALSE;
61
62 dwRet = SHGetValueW(hkExplorer, L"Advanced", L"TaskbarSmallIcons", NULL, &dwValue, &cbSize);
63 bSmallIcons = (dwRet == ERROR_SUCCESS) ? (dwValue != 0) : TRUE;
64
65 dwRet = SHGetValueW(hkExplorer, L"Advanced", L"CompactTrayIcons", NULL, &dwValue, &cbSize);
66 if (dwRet == ERROR_SUCCESS && dwValue <= TIM_Max)
67 eCompactTrayIcons = static_cast<TrayIconsMode>(dwValue);
68 else
70
71 dwRet = SHGetValueW(hkExplorer, L"Advanced", L"TaskbarSd", NULL, &dwValue, &cbSize);
72 bShowDesktopButton = (dwRet == ERROR_SUCCESS) ? (dwValue != 0) : TRUE;
73
74 cbSize = sizeof(sr);
75 dwRet = SHGetValueW(hkExplorer, L"StuckRects2", L"Settings", NULL, &sr, &cbSize);
76
77 /* Make sure we have correct values here */
78 if (dwRet != ERROR_SUCCESS || sr.cbSize != sizeof(sr) || cbSize != sizeof(sr))
79 {
85 sr.Rect.left = sr.Rect.top = 0;
86 sr.Rect.bottom = sr.Rect.right = 1;
87 sr.Size.cx = sr.Size.cy = 0;
88 }
89 else
90 {
93 }
94
95 return TRUE;
96}
TrayIconsMode
Definition: precomp.h:190
@ TIM_Max
Definition: precomp.h:194
@ TIM_Default
Definition: precomp.h:191
HKEY hkExplorer
Definition: explorer.cpp:26
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1236
unsigned long DWORD
Definition: ntddk_ex.h:95
#define L(x)
Definition: ntvdm.h:50
#define ABE_BOTTOM
Definition: shellapi.h:20
BOOL bGroupButtons
Definition: precomp.h:220
BOOL bShowDesktopButton
Definition: precomp.h:226
BOOL bHideInactiveIcons
Definition: precomp.h:223
TW_STRUCKRECTS2 sr
Definition: precomp.h:227
BOOL bShowSeconds
Definition: precomp.h:221
TrayIconsMode eCompactTrayIcons
Definition: precomp.h:225
BOOL bPreferDate
Definition: precomp.h:222
BOOL bSmallIcons
Definition: precomp.h:224
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
DWORD AutoHide
Definition: precomp.h:206
DWORD HideClock
Definition: precomp.h:209
DWORD AlwaysOnTop
Definition: precomp.h:207
DWORD SmSmallIcons
Definition: precomp.h:208
DWORD Position
Definition: precomp.h:212
DWORD cbSize
Definition: precomp.h:199
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306

Referenced by StartWithDesktop().

◆ Save()

BOOL TaskbarSettings::Save ( )

Definition at line 25 of file settings.cpp.

26{
28 SHSetValueW(hkExplorer, L"Advanced", L"PreferDateOverWeekday", REG_DWORD, &bPreferDate, sizeof(bPreferDate));
29 SHSetValueW(hkExplorer, L"Advanced", L"ShowSeconds", REG_DWORD, &bShowSeconds, sizeof(bShowSeconds));
30 SHSetValueW(hkExplorer, L"Advanced", L"TaskbarGlomming", REG_DWORD, &bGroupButtons, sizeof(bGroupButtons));
31 BOOL bAllowSizeMove = !bLock;
32 SHSetValueW(hkExplorer, L"Advanced", L"TaskbarSizeMove", REG_DWORD, &bAllowSizeMove, sizeof(bAllowSizeMove));
33 sr.cbSize = sizeof(sr);
34 SHSetValueW(hkExplorer, L"Advanced", L"TaskbarSmallIcons", REG_DWORD, &bSmallIcons, sizeof(bSmallIcons));
35 SHSetValueW(hkExplorer, L"Advanced", L"TaskbarSd", REG_DWORD, &bShowDesktopButton, sizeof(bShowDesktopButton));
36 SHSetValueW(hkExplorer, L"StuckRects2", L"Settings", REG_BINARY, &sr, sizeof(sr));
37
38 /* TODO: AutoHide writes something to HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\Components\0 figure out what and why */
39 return TRUE;
40}
DWORD WINAPI SHSetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, DWORD dwType, LPCVOID pvData, DWORD cbData)
Definition: reg.c:1306
unsigned int BOOL
Definition: ntddk_ex.h:94
#define REG_BINARY
Definition: nt_native.h:1496
#define REG_DWORD
Definition: sdbapi.c:596

Referenced by CTrayWindow::ChangingWinPos(), CTrayWindow::HandleCommand(), and CTrayWindow::OnTaskbarSettingsChanged().

◆ UseCompactTrayIcons()

BOOL TaskbarSettings::UseCompactTrayIcons ( )
inline

Definition at line 231 of file precomp.h.

232 {
233 switch (eCompactTrayIcons)
234 {
235 case TIM_NeverCompact:
236 return FALSE;
238 return TRUE;
239 default:
240 return bSmallIcons;
241 }
242 }
@ TIM_AlwaysCompact
Definition: precomp.h:193
@ TIM_NeverCompact
Definition: precomp.h:192

Referenced by CTrayNotifyWnd::AlignControls(), CSysPagerWnd::GetSize(), CTrayClockWnd::PaintLine(), and CNotifyToolbar::RefreshToolbarMetrics().

Member Data Documentation

◆ bGroupButtons

◆ bHideInactiveIcons

BOOL TaskbarSettings::bHideInactiveIcons

◆ bLock

◆ bPreferDate

BOOL TaskbarSettings::bPreferDate

◆ bShowDesktopButton

◆ bShowSeconds

◆ bSmallIcons

◆ eCompactTrayIcons

TrayIconsMode TaskbarSettings::eCompactTrayIcons

Definition at line 225 of file precomp.h.

Referenced by Load(), CNotifyToolbar::RefreshToolbarMetrics(), and UseCompactTrayIcons().

◆ sr


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