ReactOS 0.4.15-dev-7958-gcd0bb1a
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 10 of file advmon.c.

Function Documentation

◆ BuildAdvPropTitle()

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

Definition at line 52 of file advmon.c.

53{
54 UINT uiMonitorName, uiDisplayName;
55 LPTSTR lpMonitorName, lpDisplayName;
56 TCHAR szFormatBuff[32];
57
58 if (!LoadString(hApplet, IDS_ADVANCEDTITLEFMT, szFormatBuff, sizeof(szFormatBuff) / sizeof(szFormatBuff[0])))
59 {
60 szFormatBuff[0] = _T('\0');
61 }
62
65
66 lpMonitorName = QueryDeskCplString(pdo, uiMonitorName);
67 lpDisplayName = QueryDeskCplString(pdo, uiDisplayName);
68
69 _sntprintf(lpBuffer, dwBufferLen, szFormatBuff, lpMonitorName, lpDisplayName);
70
71 if (lpMonitorName != NULL)
72 LocalFree((HLOCAL)lpMonitorName);
73 if (lpDisplayName != NULL)
75}
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 _T(x)
Definition: vfdio.h:22
_In_ LPCSTR _Out_writes_to_opt_ cchDisplayName LPSTR lpDisplayName
Definition: winbase.h:2790
#define RegisterClipboardFormat
Definition: winuser.h:5838
#define LoadString
Definition: winuser.h:5819
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 78 of file advmon.c.

79{
80 TCHAR szCaption[128];
83 HPSXA hpsxaDev, hpsxaDisp;
84 BOOL Ret;
85 IDataObject *pdo;
86
87 /* FIXME: Build the "%s and %s" caption string for the monitor and adapter name */
88 szCaption[0] = _T('\0');
89
90 ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
91 psh.dwSize = sizeof(PROPSHEETHEADER);
92 psh.dwFlags = PSH_PROPTITLE;
93 psh.hwndParent = hWndParent;
94 psh.hInstance = hApplet;
95 psh.pszCaption = szCaption;
96 psh.phpage = hpsp;
97
99
100 pdo = CreateDevSettings(DisplayDevice);
101
102 if (pdo != NULL)
103 BuildAdvPropTitle(pdo, szCaption, sizeof(szCaption) / sizeof(szCaption[0]));
104
106 if (hpsxaDev != NULL)
108
110 if (hpsxaDisp != NULL)
112
113 Ret = (LONG)(PropertySheet(&psh) != -1);
114
115 if (hpsxaDisp != NULL)
117
118 if (hpsxaDev != NULL)
120
121 IDataObject_Release(pdo);
122
123 return Ret;
124}
static BOOL CALLBACK PropSheetAddPage(HPROPSHEETPAGE hpage, LPARAM lParam)
Definition: advmon.c:13
static BOOL DisplayAdvancedSettingsInitPropSheetPage(PROPSHEETHEADER *ppsh, WORD idDlg, DLGPROC DlgProc, LPARAM lParam)
Definition: advmon.c:26
#define MAX_ADVANCED_PAGES
Definition: advmon.c:10
static VOID BuildAdvPropTitle(IDataObject *pdo, LPTSTR lpBuffer, DWORD dwBufferLen)
Definition: advmon.c:52
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:2190
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
Definition: shellord.c:2013
#define ZeroMemory
Definition: winbase.h:1712
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 26 of file advmon.c.

27{
28 HPROPSHEETPAGE hPage;
29 PROPSHEETPAGE psp;
30
31 if (ppsh->nPages < MAX_ADVANCED_PAGES)
32 {
33 ZeroMemory(&psp, sizeof(psp));
34 psp.dwSize = sizeof(psp);
35 psp.dwFlags = PSP_DEFAULT;
36 psp.hInstance = hApplet;
37 psp.pszTemplate = MAKEINTRESOURCE(idDlg);
38 psp.pfnDlgProc = DlgProc;
39 psp.lParam = lParam;
40
41 hPage = CreatePropertySheetPage(&psp);
42 if (hPage != NULL)
43 {
44 return PropSheetAddPage(hPage, (LPARAM)ppsh);
45 }
46 }
47
48 return FALSE;
49}
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 13 of file advmon.c.

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

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