ReactOS 0.4.16-dev-1946-g52006dd
performance.c File Reference
#include "precomp.h"
#include <shlguid_undoc.h>
#include <shlobj_undoc.h>
Include dependency graph for performance.c:

Go to the source code of this file.

Functions

static VOID RegTreeOpt_OnDestroy (IRegTreeOptions *pRTO)
 
static BOOL RegTreeOpt_ToggleCheckItem (IRegTreeOptions *pRTO, HTREEITEM hItem)
 
static BOOL RegTreeOpt_OnTreeViewClick (IRegTreeOptions *pRTO, HWND hWndTree)
 
static BOOL RegTreeOpt_OnTreeViewKeyDown (IRegTreeOptions *pRTO, HWND hWndTree, TV_KEYDOWN *pKey)
 
static INT_PTR CALLBACK VisualEffectsDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK AdvancedDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
VOID ShowPerformanceOptions (HWND hDlg)
 

Function Documentation

◆ AdvancedDlgProc()

static INT_PTR CALLBACK AdvancedDlgProc ( HWND  hDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 114 of file performance.c.

115{
116 switch (uMsg)
117 {
118 case WM_INITDIALOG:
119 // TODO: Not implemented yet
122 return TRUE;
123
124 case WM_COMMAND:
125 switch (LOWORD(wParam))
126 {
127 case IDC_CHANGESWAP:
129 break;
130 }
131 break;
132 }
133 return FALSE;
134}
WPARAM wParam
Definition: combotst.c:138
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HINSTANCE hApplet
Definition: access.c:17
INT_PTR CALLBACK VirtMemDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: virtmem.c:821
#define IDC_CPUCLIENT
Definition: resource.h:163
#define IDC_CPUSERVER
Definition: resource.h:164
#define IDD_VIRTMEM
Definition: resource.h:168
#define IDC_CHANGESWAP
Definition: resource.h:165
#define LOWORD(l)
Definition: pedump.c:82
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4501
#define WM_COMMAND
Definition: winuser.h:1768
#define WM_INITDIALOG
Definition: winuser.h:1767
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by ShowPerformanceOptions().

◆ RegTreeOpt_OnDestroy()

static VOID RegTreeOpt_OnDestroy ( IRegTreeOptions *  pRTO)
static

Definition at line 15 of file performance.c.

16{
17 if (pRTO)
18 {
19 IRegTreeOptions_WalkTree(pRTO, WALK_TREE_DESTROY);
20 IRegTreeOptions_Release(pRTO);
21 }
22}
@ WALK_TREE_DESTROY
Definition: shlobj_undoc.h:496

Referenced by VisualEffectsDlgProc().

◆ RegTreeOpt_OnTreeViewClick()

static BOOL RegTreeOpt_OnTreeViewClick ( IRegTreeOptions *  pRTO,
HWND  hWndTree 
)
static

Definition at line 31 of file performance.c.

32{
33 TV_HITTESTINFO HitTest;
34 DWORD dwPos = GetMessagePos();
35 HitTest.pt.x = GET_X_LPARAM(dwPos);
36 HitTest.pt.y = GET_Y_LPARAM(dwPos);
37 ScreenToClient(hWndTree, &HitTest.pt);
38 HTREEITEM hItem = TreeView_HitTest(hWndTree, &HitTest);
40}
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL RegTreeOpt_ToggleCheckItem(IRegTreeOptions *pRTO, HTREEITEM hItem)
Definition: performance.c:25
#define TV_HITTESTINFO
Definition: commctrl.h:3521
#define TreeView_HitTest(hwnd, lpht)
Definition: commctrl.h:3518
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
DWORD WINAPI GetMessagePos(void)
Definition: message.c:1351
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

Referenced by VisualEffectsDlgProc().

◆ RegTreeOpt_OnTreeViewKeyDown()

static BOOL RegTreeOpt_OnTreeViewKeyDown ( IRegTreeOptions *  pRTO,
HWND  hWndTree,
TV_KEYDOWN pKey 
)
static

Definition at line 43 of file performance.c.

44{
45 if (pKey->wVKey == VK_SPACE)
47 else if (pKey->wVKey == VK_F5 && pRTO)
48 IRegTreeOptions_WalkTree(pRTO, WALK_TREE_REFRESH);
49 return FALSE;
50}
FxRegKey * pKey
#define TreeView_GetSelection(hwnd)
Definition: commctrl.h:3478
@ WALK_TREE_REFRESH
Definition: shlobj_undoc.h:498
#define VK_SPACE
Definition: winuser.h:2255
#define VK_F5
Definition: winuser.h:2295

Referenced by VisualEffectsDlgProc().

◆ RegTreeOpt_ToggleCheckItem()

static BOOL RegTreeOpt_ToggleCheckItem ( IRegTreeOptions *  pRTO,
HTREEITEM  hItem 
)
static

Definition at line 25 of file performance.c.

26{
27 return pRTO && SUCCEEDED(IRegTreeOptions_ToggleItem(pRTO, hItem));
28}
#define SUCCEEDED(hr)
Definition: intsafe.h:50

Referenced by RegTreeOpt_OnTreeViewClick(), and RegTreeOpt_OnTreeViewKeyDown().

◆ ShowPerformanceOptions()

VOID ShowPerformanceOptions ( HWND  hDlg)

Definition at line 137 of file performance.c.

138{
139 HRESULT hrInit = CoInitialize(NULL); // For IRegTreeOptions
140 PROPSHEETHEADERW psh = { sizeof(psh), PSH_PROPSHEETPAGE | PSH_NOCONTEXTHELP };
141 PROPSHEETPAGEW pages[2] = { 0 };
142
143 pages[0].dwSize = sizeof(*pages);
144 pages[0].hInstance = hApplet;
147
148 pages[1].dwSize = sizeof(*pages);
149 pages[1].hInstance = hApplet;
151 pages[1].pfnDlgProc = AdvancedDlgProc;
152
153 psh.hwndParent = hDlg;
154 psh.hInstance = hApplet;
156 psh.nPages = _countof(pages);
157 psh.ppsp = pages;
158
159 PropertySheetW(&psh);
160
161 if (SUCCEEDED(hrInit))
163}
#define NULL
Definition: types.h:112
#define IDS_PERFORMANCEOPTIONS
Definition: resource.h:17
#define IDD_VISUALEFFECTS
Definition: resource.h:158
#define IDD_ADVANCEDPERF
Definition: resource.h:162
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2916
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
static INT_PTR CALLBACK VisualEffectsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: performance.c:53
static INT_PTR CALLBACK AdvancedDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: performance.c:114
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define _countof(array)
Definition: sndvol32.h:70
LPCPROPSHEETPAGEW ppsp
Definition: prsht.h:308
HINSTANCE hInstance
Definition: prsht.h:296
HWND hwndParent
Definition: prsht.h:295
LPCWSTR pszCaption
Definition: prsht.h:301
DLGPROC pfnDlgProc
Definition: prsht.h:226
DWORD dwSize
Definition: prsht.h:214
LPCWSTR pszTemplate
Definition: prsht.h:218
HINSTANCE hInstance
Definition: prsht.h:216

Referenced by AdvancedPageProc(), and SystemApplet().

◆ VisualEffectsDlgProc()

static INT_PTR CALLBACK VisualEffectsDlgProc ( HWND  hDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 53 of file performance.c.

54{
55 IRegTreeOptions *pRTO = (IRegTreeOptions*)GetWindowLongPtrW(hDlg, DWLP_USER);
56 HWND hWndTree = GetDlgItem(hDlg, IDC_TREE);
57
58 switch (uMsg)
59 {
60 case WM_INITDIALOG:
61 {
62 IRegTreeOptions *pRTO = NULL;
63 if (SUCCEEDED(CoCreateInstance(&CLSID_CRegTreeOptions, NULL, CLSCTX_INPROC_SERVER,
64 &IID_IRegTreeOptions, (void**)&pRTO)))
65 {
66 LPCSTR pszPath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\VisualEffects";
68 IRegTreeOptions_InitTree(pRTO, hWndTree, HKEY_LOCAL_MACHINE, pszPath, NULL);
69 }
70 else
71 {
72 // Without IRegTreeOptions, our page is pointless so we remove it.
73 // MSDN says we have to post the remove message from inside WM_INITDIALOG.
74 HWND hWndPS = GetParent(hDlg);
75 int iPage = PropSheet_HwndToIndex(hWndPS, hDlg);
76 PostMessage(hWndPS, PSM_REMOVEPAGE, 0, SendMessageW(hWndPS, PSM_INDEXTOPAGE, iPage, 0));
77 }
78 return TRUE;
79 }
80
81 case WM_DESTROY:
84 break;
85
86 case WM_NOTIFY:
87 switch (((LPNMHDR)lParam)->code)
88 {
89 case NM_CLICK:
90 if (RegTreeOpt_OnTreeViewClick(pRTO, hWndTree))
91 PropSheet_Changed(GetParent(hDlg), hDlg);
92 break;
93
94 case TVN_KEYDOWN:
95 if (RegTreeOpt_OnTreeViewKeyDown(pRTO, hWndTree, (TV_KEYDOWN*)lParam))
96 PropSheet_Changed(GetParent(hDlg), hDlg);
97 break;
98
99 case PSN_APPLY:
100 {
101 if (pRTO)
102 IRegTreeOptions_WalkTree(pRTO, WALK_TREE_SAVE);
103
104 SHSendMessageBroadcastW(WM_SETTINGCHANGE, 0, 0); // For the ListviewShadow setting
105 return TRUE;
106 }
107 }
108 break;
109 }
110 return FALSE;
111}
LPARAM lParam
Definition: combotst.c:139
#define IDC_TREE
Definition: resource.h:159
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
DWORD WINAPI SHSendMessageBroadcastW(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: ordinal.c:4195
LONG_PTR LPARAM
Definition: minwindef.h:175
static BOOL RegTreeOpt_OnTreeViewClick(IRegTreeOptions *pRTO, HWND hWndTree)
Definition: performance.c:31
static BOOL RegTreeOpt_OnTreeViewKeyDown(IRegTreeOptions *pRTO, HWND hWndTree, TV_KEYDOWN *pKey)
Definition: performance.c:43
static VOID RegTreeOpt_OnDestroy(IRegTreeOptions *pRTO)
Definition: performance.c:15
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSM_REMOVEPAGE
Definition: prsht.h:166
#define PSN_APPLY
Definition: prsht.h:117
#define TVN_KEYDOWN
Definition: commctrl.h:3718
#define NM_CLICK
Definition: commctrl.h:130
#define TV_KEYDOWN
Definition: commctrl.h:3727
#define WM_NOTIFY
Definition: richedit.h:61
@ WALK_TREE_SAVE
Definition: shlobj_undoc.h:495
Definition: inflate.c:139
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define DWLP_USER
Definition: winuser.h:883
#define GetWindowLongPtrW
Definition: winuser.h:4931
#define WM_SETTINGCHANGE
Definition: winuser.h:1657
#define PostMessage
Definition: winuser.h:5943
HWND WINAPI GetParent(_In_ HWND)
#define WM_DESTROY
Definition: winuser.h:1637
#define SetWindowLongPtrW
Definition: winuser.h:5457
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by ShowPerformanceOptions().