ReactOS 0.4.16-dev-555-g690643f
advmon.c File Reference
#include "desk.h"
Include dependency graph for advmon.c:

Go to the source code of this file.

Macros

#define MAX_ADVANCED_PAGES   32
 

Functions

static BOOL CALLBACK PropSheetAddPage (HPROPSHEETPAGE hpage, LPARAM lParam)
 
static BOOL DisplayAdvancedSettingsInitPropSheetPage (PROPSHEETHEADER *ppsh, WORD idDlg, DLGPROC DlgProc, LPARAM lParam)
 
static VOID BuildAdvPropTitle (IDataObject *pdo, LPTSTR lpBuffer, DWORD dwBufferLen)
 
BOOL DisplayAdvancedSettings (HWND hWndParent, PDISPLAY_DEVICE_ENTRY DisplayDevice)
 

Macro Definition Documentation

◆ MAX_ADVANCED_PAGES

#define MAX_ADVANCED_PAGES   32

Definition at line 9 of file advmon.c.

Function Documentation

◆ BuildAdvPropTitle()

static VOID BuildAdvPropTitle ( IDataObject pdo,
LPTSTR  lpBuffer,
DWORD  dwBufferLen 
)
static

Definition at line 51 of file advmon.c.

52{
53 UINT uiMonitorName, uiDisplayName;
54 LPTSTR lpMonitorName, lpDisplayName;
55 TCHAR szFormatBuff[32];
56
57 if (!LoadString(hApplet, IDS_ADVANCEDTITLEFMT, szFormatBuff, _countof(szFormatBuff)))
58 {
59 szFormatBuff[0] = _T('\0');
60 }
61
64
65 lpMonitorName = QueryDeskCplString(pdo, uiMonitorName);
66 lpDisplayName = QueryDeskCplString(pdo, uiDisplayName);
67
68 _sntprintf(lpBuffer, dwBufferLen, szFormatBuff, lpMonitorName, lpDisplayName);
69
70 if (lpMonitorName != NULL)
71 LocalFree((HLOCAL)lpMonitorName);
72 if (lpDisplayName != NULL)
74}
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define DESK_EXT_MONITORNAME
Definition: deskcplx.h:13
static __inline LPTSTR QueryDeskCplString(IDataObject *pdo, UINT cfFormat)
Definition: deskcplx.h:84
#define DESK_EXT_DISPLAYNAME
Definition: deskcplx.h:9
#define NULL
Definition: types.h:112
HINSTANCE hApplet
Definition: access.c:17
#define IDS_ADVANCEDTITLEFMT
Definition: resource.h:159
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
unsigned int UINT
Definition: ndis.h:50
#define _countof(array)
Definition: sndvol32.h:70
#define _T(x)
Definition: vfdio.h:22
_In_ LPCSTR _Out_writes_to_opt_ cchDisplayName LPSTR lpDisplayName
Definition: winbase.h:2815
#define RegisterClipboardFormat
Definition: winuser.h:5850
#define LoadString
Definition: winuser.h:5831
char TCHAR
Definition: xmlstorage.h:189
#define _sntprintf
Definition: xmlstorage.h:201
CHAR * LPTSTR
Definition: xmlstorage.h:192

Referenced by DisplayAdvancedSettings().

◆ 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
#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 ZeroMemory
Definition: winbase.h:1737
LONG_PTR LPARAM
Definition: windef.h:208
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by SettingsPageProc().

◆ DisplayAdvancedSettingsInitPropSheetPage()

static BOOL DisplayAdvancedSettingsInitPropSheetPage ( PROPSHEETHEADER ppsh,
WORD  idDlg,
DLGPROC  DlgProc,
LPARAM  lParam 
)
static

Definition at line 25 of file advmon.c.

26{
27 HPROPSHEETPAGE hPage;
28 PROPSHEETPAGE psp;
29
30 if (ppsh->nPages < MAX_ADVANCED_PAGES)
31 {
32 ZeroMemory(&psp, sizeof(psp));
33 psp.dwSize = sizeof(psp);
34 psp.dwFlags = PSP_DEFAULT;
35 psp.hInstance = hApplet;
36 psp.pszTemplate = MAKEINTRESOURCE(idDlg);
37 psp.pfnDlgProc = DlgProc;
38 psp.lParam = lParam;
39
40 hPage = CreatePropertySheetPage(&psp);
41 if (hPage != NULL)
42 {
43 return PropSheetAddPage(hPage, (LPARAM)ppsh);
44 }
45 }
46
47 return FALSE;
48}
LPARAM lParam
Definition: combotst.c:139
WORD idDlg
Definition: desk.c:121
DLGPROC DlgProc
Definition: desk.c:122
#define FALSE
Definition: types.h:117
#define CreatePropertySheetPage
Definition: prsht.h:399
#define PSP_DEFAULT
Definition: prsht.h:22
#define PROPSHEETPAGE
Definition: prsht.h:389
#define MAKEINTRESOURCE
Definition: winuser.h:591

Referenced by DisplayAdvancedSettings().

◆ PropSheetAddPage()

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

Definition at line 12 of file advmon.c.

13{
15 if (ppsh != NULL && ppsh->nPages < MAX_ADVANCED_PAGES)
16 {
17 ppsh->phpage[ppsh->nPages++] = hpage;
18 return TRUE;
19 }
20
21 return FALSE;
22}
#define TRUE
Definition: types.h:120

Referenced by DisplayAdvancedSettings(), DisplayAdvancedSettingsInitPropSheetPage(), KeyboardApplet(), and MouseApplet().