ReactOS  0.4.14-dev-614-gbfd8a84
deskcplx.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _DESK_EXT_INTERFACE
 

Macros

#define DESK_EXT_CALLBACK   CALLBACK
 
#define DESK_EXT_EXTINTERFACE   TEXT("Desk.cpl extension interface")
 
#define DESK_EXT_PRUNINGMODE   TEXT("Pruning Mode")
 
#define DESK_EXT_DISPLAYDEVICE   TEXT("Display Device")
 
#define DESK_EXT_DISPLAYNAME   TEXT("Display Name")
 
#define DESK_EXT_DISPLAYID   TEXT("Display ID")
 
#define DESK_EXT_DISPLAYKEY   TEXT("Display Key")
 
#define DESK_EXT_DISPLAYSTATEFLAGS   TEXT("Display State Flags")
 
#define DESK_EXT_MONITORNAME   TEXT("Monitor Name")
 
#define DESK_EXT_MONITORDEVICE   TEXT("Monitor Device")
 

Typedefs

typedef PDEVMODEW(DESK_EXT_CALLBACKPDESK_EXT_ENUMALLMODES) (PVOID Context, DWORD Index)
 
typedef PDEVMODEW(DESK_EXT_CALLBACKPDESK_EXT_GETCURRENTMODE) (PVOID Context)
 
typedef BOOL(DESK_EXT_CALLBACKPDESK_EXT_SETCURRENTMODE) (PVOID Context, const DEVMODEW *pDevMode)
 
typedef VOID(DESK_EXT_CALLBACKPDESK_EXT_GETPRUNINGMODE) (PVOID Context, PBOOL pbModesPruned, PBOOL pbKeyIsReadOnly, PBOOL pbPruningOn)
 
typedef VOID(DESK_EXT_CALLBACKPDESK_EXT_SETPRUNINGMODE) (PVOID Context, BOOL PruningOn)
 
typedef struct _DESK_EXT_INTERFACE DESK_EXT_INTERFACE
 
typedef struct _DESK_EXT_INTERFACEPDESK_EXT_INTERFACE
 

Functions

LONG WINAPI DisplaySaveSettings (PVOID pContext, HWND hwndPropSheet)
 
static __inline PDESK_EXT_INTERFACE QueryDeskCplExtInterface (IDataObject *pdo)
 
static __inline LPTSTR QueryDeskCplString (IDataObject *pdo, UINT cfFormat)
 
static __inline LONG DeskCplExtDisplaySaveSettings (PDESK_EXT_INTERFACE DeskExtInterface, HWND hwndDlg)
 

Macro Definition Documentation

◆ DESK_EXT_CALLBACK

#define DESK_EXT_CALLBACK   CALLBACK

Definition at line 4 of file deskcplx.h.

◆ DESK_EXT_DISPLAYDEVICE

#define DESK_EXT_DISPLAYDEVICE   TEXT("Display Device")

Definition at line 8 of file deskcplx.h.

◆ DESK_EXT_DISPLAYID

#define DESK_EXT_DISPLAYID   TEXT("Display ID")

Definition at line 10 of file deskcplx.h.

◆ DESK_EXT_DISPLAYKEY

#define DESK_EXT_DISPLAYKEY   TEXT("Display Key")

Definition at line 11 of file deskcplx.h.

◆ DESK_EXT_DISPLAYNAME

#define DESK_EXT_DISPLAYNAME   TEXT("Display Name")

Definition at line 9 of file deskcplx.h.

◆ DESK_EXT_DISPLAYSTATEFLAGS

#define DESK_EXT_DISPLAYSTATEFLAGS   TEXT("Display State Flags")

Definition at line 12 of file deskcplx.h.

◆ DESK_EXT_EXTINTERFACE

#define DESK_EXT_EXTINTERFACE   TEXT("Desk.cpl extension interface")

Definition at line 6 of file deskcplx.h.

◆ DESK_EXT_MONITORDEVICE

#define DESK_EXT_MONITORDEVICE   TEXT("Monitor Device")

Definition at line 14 of file deskcplx.h.

◆ DESK_EXT_MONITORNAME

#define DESK_EXT_MONITORNAME   TEXT("Monitor Name")

Definition at line 13 of file deskcplx.h.

◆ DESK_EXT_PRUNINGMODE

#define DESK_EXT_PRUNINGMODE   TEXT("Pruning Mode")

Definition at line 7 of file deskcplx.h.

Typedef Documentation

◆ DESK_EXT_INTERFACE

◆ PDESK_EXT_ENUMALLMODES

typedef PDEVMODEW(DESK_EXT_CALLBACK * PDESK_EXT_ENUMALLMODES) (PVOID Context, DWORD Index)

Definition at line 16 of file deskcplx.h.

◆ PDESK_EXT_GETCURRENTMODE

typedef PDEVMODEW(DESK_EXT_CALLBACK * PDESK_EXT_GETCURRENTMODE) (PVOID Context)

Definition at line 17 of file deskcplx.h.

◆ PDESK_EXT_GETPRUNINGMODE

typedef VOID(DESK_EXT_CALLBACK * PDESK_EXT_GETPRUNINGMODE) (PVOID Context, PBOOL pbModesPruned, PBOOL pbKeyIsReadOnly, PBOOL pbPruningOn)

Definition at line 19 of file deskcplx.h.

◆ PDESK_EXT_INTERFACE

◆ PDESK_EXT_SETCURRENTMODE

typedef BOOL(DESK_EXT_CALLBACK * PDESK_EXT_SETCURRENTMODE) (PVOID Context, const DEVMODEW *pDevMode)

Definition at line 18 of file deskcplx.h.

◆ PDESK_EXT_SETPRUNINGMODE

typedef VOID(DESK_EXT_CALLBACK * PDESK_EXT_SETPRUNINGMODE) (PVOID Context, BOOL PruningOn)

Definition at line 20 of file deskcplx.h.

Function Documentation

◆ DeskCplExtDisplaySaveSettings()

static __inline LONG DeskCplExtDisplaySaveSettings ( PDESK_EXT_INTERFACE  DeskExtInterface,
HWND  hwndDlg 
)
static

Definition at line 122 of file deskcplx.h.

124 {
125  typedef LONG (WINAPI *PDISPLAYSAVESETTINGS)(PVOID, HWND);
126  HMODULE hModDeskCpl;
127  PDISPLAYSAVESETTINGS pDisplaySaveSettings;
128  LONG lRet = DISP_CHANGE_BADPARAM;
129 
130  /* We could use GetModuleHandle() instead, but then this routine
131  wouldn't work if some other application hosts the shell extension */
132  hModDeskCpl = LoadLibrary(TEXT("desk.cpl"));
133  if (hModDeskCpl != NULL)
134  {
135  pDisplaySaveSettings = (PDISPLAYSAVESETTINGS)GetProcAddress(hModDeskCpl,
136  "DisplaySaveSettings");
137  if (pDisplaySaveSettings != NULL)
138  {
139  lRet = pDisplaySaveSettings(DeskExtInterface->Context,
140  hwndDlg);
141  }
142 
143  FreeLibrary(hModDeskCpl);
144  }
145 
146  return lRet;
147 }
#define LoadLibrary
Definition: winbase.h:3696
HANDLE HWND
Definition: compat.h:13
long LONG
Definition: pedump.c:60
#define DISP_CHANGE_BADPARAM
Definition: winuser.h:193
smooth NULL
Definition: ftsmooth.c:416
void * PVOID
Definition: retypes.h:9
#define FreeLibrary(x)
Definition: compat.h:413
#define WINAPI
Definition: msvc.h:6
#define TEXT(s)
Definition: k32.h:26
#define GetProcAddress(x, y)
Definition: compat.h:418

Referenced by ApplyDisplayAdapterChanges(), and ApplyMonitorChanges().

◆ DisplaySaveSettings()

LONG WINAPI DisplaySaveSettings ( PVOID  pContext,
HWND  hwndPropSheet 
)

Definition at line 912 of file devsett.c.

914 {
915  //PCDevSettings This = impl_from_IDataObject((IDataObject *)Context);
916  DPRINT("DisplaySaveSettings() UNIMPLEMENTED!\n");
917  return DISP_CHANGE_BADPARAM;
918 }
#define DISP_CHANGE_BADPARAM
Definition: winuser.h:193
void DPRINT(...)
Definition: polytest.cpp:61

◆ QueryDeskCplExtInterface()

static __inline PDESK_EXT_INTERFACE QueryDeskCplExtInterface ( IDataObject pdo)
static

Definition at line 48 of file deskcplx.h.

49 {
50  PDESK_EXT_INTERFACE pRecvBuffer, pExtIface = NULL;
51  FORMATETC fetc;
52  STGMEDIUM medium;
53 
54  fetc.cfFormat = (CLIPFORMAT)RegisterClipboardFormat(DESK_EXT_EXTINTERFACE);
55  fetc.ptd = NULL;
56  fetc.dwAspect = DVASPECT_CONTENT;
57  fetc.lindex = -1;
58  fetc.tymed = TYMED_HGLOBAL;
59 
60  if (SUCCEEDED(IDataObject_GetData(pdo, &fetc, &medium)) && medium.hGlobal != NULL)
61  {
62  /* We always receive the string in unicode! */
63  pRecvBuffer = (PDESK_EXT_INTERFACE)GlobalLock(medium.hGlobal);
64 
65  if (pRecvBuffer->cbSize == sizeof(*pRecvBuffer))
66  {
67  pExtIface = LocalAlloc(LMEM_FIXED, sizeof(*pExtIface));
68  if (pExtIface != NULL)
69  {
70  CopyMemory(pExtIface,
71  pRecvBuffer,
72  sizeof(*pRecvBuffer));
73  }
74  }
75 
76  GlobalUnlock(medium.hGlobal);
77  ReleaseStgMedium(&medium);
78  }
79 
80  return pExtIface;
81 }
struct _DESK_EXT_INTERFACE * PDESK_EXT_INTERFACE
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
smooth NULL
Definition: ftsmooth.c:416
#define LMEM_FIXED
Definition: winbase.h:349
#define DESK_EXT_EXTINTERFACE
Definition: deskcplx.h:6
#define CopyMemory
Definition: winbase.h:1640
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
#define RegisterClipboardFormat
Definition: winuser.h:5813
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by IDeskDisplayAdapter_Initialize(), and IDeskMonitor_Initialize().

◆ QueryDeskCplString()

static __inline LPTSTR QueryDeskCplString ( IDataObject pdo,
UINT  cfFormat 
)
static

Definition at line 84 of file deskcplx.h.

85 {
86  FORMATETC fetc;
87  STGMEDIUM medium;
88  SIZE_T BufLen;
89  LPWSTR lpRecvBuffer;
90  LPTSTR lpStr = NULL;
91 
92  fetc.cfFormat = (CLIPFORMAT)cfFormat;
93  fetc.ptd = NULL;
94  fetc.dwAspect = DVASPECT_CONTENT;
95  fetc.lindex = -1;
96  fetc.tymed = TYMED_HGLOBAL;
97 
98  if (SUCCEEDED(IDataObject_GetData(pdo, &fetc, &medium)) && medium.hGlobal != NULL)
99  {
100  /* We always receive the string in unicode! */
101  lpRecvBuffer = (LPWSTR)GlobalLock(medium.hGlobal);
102 
103  BufLen = wcslen(lpRecvBuffer) + 1;
104  lpStr = LocalAlloc(LMEM_FIXED, BufLen * sizeof(TCHAR));
105  if (lpStr != NULL)
106  {
107 #ifdef UNICODE
108  wcscpy(lpStr, lpRecvBuffer);
109 #else
110  WideCharToMultiByte(CP_ACP, 0, lpRecvBuffer, -1, lpStr, BufLen, NULL, NULL);
111 #endif
112  }
113 
114  GlobalUnlock(medium.hGlobal);
115  ReleaseStgMedium(&medium);
116  }
117 
118  return lpStr;
119 }
#define WideCharToMultiByte
Definition: compat.h:101
#define BufLen
Definition: fatfs.h:167
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
#define CP_ACP
Definition: compat.h:99
CHAR * LPTSTR
Definition: xmlstorage.h:192
smooth NULL
Definition: ftsmooth.c:416
#define LMEM_FIXED
Definition: winbase.h:349
char TCHAR
Definition: xmlstorage.h:189
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
ULONG_PTR SIZE_T
Definition: typedefs.h:78
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373
WCHAR * LPWSTR
Definition: xmlstorage.h:184
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by BuildAdvPropTitle(), InitDisplayAdapterDialog(), and InitMonitorDialog().