ReactOS 0.4.15-dev-7705-g2320c37
deskadp.c File Reference
#include "precomp.h"
#include <tchar.h>
#include <debug.h>
#include "resource.h"
Include dependency graph for deskadp.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Typedefs

typedef INT_PTR(WINAPIPDEVICEPROPERTIESW) (HWND, LPCWSTR, LPCWSTR, BOOL)
 

Functions

static VOID GetColorDescription (PDEVMODEW lpDevMode, LPTSTR lpBuffer, DWORD dwBufferLen)
 
static VOID GetRefreshRateDescription (PDEVMODEW lpDevMode, LPTSTR lpBuffer, DWORD dwBufferLen)
 
static VOID InitListAllModesDialog (PDESKDISPLAYADAPTER This, HWND hwndListAllModesDlg)
 
static BOOL ChangeSelectedMode (PDESKDISPLAYADAPTER This, HWND hwndListAllModesDlg)
 
static INT_PTR CALLBACK ListAllModesDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID ShowListAllModes (PDESKDISPLAYADAPTER This)
 
static VOID ShowAdapterProperties (PDESKDISPLAYADAPTER This)
 
static VOID InitDisplayAdapterDialog (PDESKDISPLAYADAPTER This)
 
static LONG ApplyDisplayAdapterChanges (PDESKDISPLAYADAPTER This)
 
static VOID ResetDisplayAdapterChanges (PDESKDISPLAYADAPTER This)
 
static INT_PTR CALLBACK DisplayAdapterDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID IDeskDisplayAdapter_Destroy (PDESKDISPLAYADAPTER This)
 
ULONG IDeskDisplayAdapter_AddRef (PDESKDISPLAYADAPTER This)
 
ULONG IDeskDisplayAdapter_Release (PDESKDISPLAYADAPTER This)
 
HRESULT STDMETHODCALLTYPE IDeskDisplayAdapter_QueryInterface (PDESKDISPLAYADAPTER This, REFIID iid, PVOID *pvObject)
 
HRESULT IDeskDisplayAdapter_Initialize (PDESKDISPLAYADAPTER This, LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID)
 
HRESULT IDeskDisplayAdapter_AddPages (PDESKDISPLAYADAPTER This, LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam)
 
HRESULT IDeskDisplayAdapter_ReplacePage (PDESKDISPLAYADAPTER This, EXPPS uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam)
 
HRESULT IDeskDisplayAdapter_Constructor (REFIID riid, LPVOID *ppv)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
 

Variables

static HINSTANCE hInstance
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 5 of file deskadp.c.

Typedef Documentation

◆ PDEVICEPROPERTIESW

typedef INT_PTR(WINAPI * PDEVICEPROPERTIESW) (HWND, LPCWSTR, LPCWSTR, BOOL)

Definition at line 12 of file deskadp.c.

Function Documentation

◆ ApplyDisplayAdapterChanges()

static LONG ApplyDisplayAdapterChanges ( PDESKDISPLAYADAPTER  This)
static

Definition at line 351 of file deskadp.c.

352{
353 LONG lChangeRet;
354
355 if (This->DeskExtInterface != NULL)
356 {
357 /* Change the display settings through desk.cpl */
358 lChangeRet = DeskCplExtDisplaySaveSettings(This->DeskExtInterface,
359 This->hwndDlg);
360 if (lChangeRet == DISP_CHANGE_SUCCESSFUL)
361 {
362 /* Save the new mode */
363 This->lpDevModeOnInit = This->DeskExtInterface->GetCurrentMode(This->DeskExtInterface->Context);
364 This->lpSelDevMode = This->lpDevModeOnInit;
365 return PSNRET_NOERROR;
366 }
367 else if (lChangeRet == DISP_CHANGE_RESTART)
368 {
369 /* Notify desk.cpl that the user needs to reboot */
371 return PSNRET_NOERROR;
372 }
373 }
374
376}
static __inline LONG DeskCplExtDisplaySaveSettings(PDESK_EXT_INTERFACE DeskExtInterface, HWND hwndDlg)
Definition: deskcplx.h:122
#define NULL
Definition: types.h:112
long LONG
Definition: pedump.c:60
#define PSNRET_INVALID_NOCHANGEPAGE
Definition: prsht.h:131
#define PSNRET_NOERROR
Definition: prsht.h:129
#define PropSheet_RestartWindows(d)
Definition: prsht.h:352
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190
HWND WINAPI GetParent(_In_ HWND)
#define DISP_CHANGE_RESTART
Definition: winuser.h:191

Referenced by DisplayAdapterDlgProc().

◆ ChangeSelectedMode()

static BOOL ChangeSelectedMode ( PDESKDISPLAYADAPTER  This,
HWND  hwndListAllModesDlg 
)
static

Definition at line 159 of file deskadp.c.

161{
162 INT i;
163 PDEVMODEW lpSelDevMode = NULL;
164 BOOL bRet = FALSE;
165
166 i = (INT)SendDlgItemMessage(hwndListAllModesDlg,
169 0,
170 0);
171
172 if (i >= 0)
173 {
174 lpSelDevMode = (PDEVMODEW)SendDlgItemMessage(hwndListAllModesDlg,
177 (WPARAM)i,
178 0);
179 }
180
181 if (lpSelDevMode != NULL)
182 {
183 This->lpSelDevMode = lpSelDevMode;
184 bRet = TRUE;
185 }
186
187 return bRet;
188}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDC_ALLVALIDMODES
Definition: resource.h:16
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define INT
Definition: polytest.cpp:20
int32_t INT
Definition: typedefs.h:58
UINT_PTR WPARAM
Definition: windef.h:207
struct _devicemodeW * PDEVMODEW
#define LB_GETITEMDATA
Definition: winuser.h:2040
#define LB_GETCURSEL
Definition: winuser.h:2038
#define SendDlgItemMessage
Definition: winuser.h:5841

Referenced by ListAllModesDlgProc().

◆ DisplayAdapterDlgProc()

static INT_PTR CALLBACK DisplayAdapterDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 389 of file deskadp.c.

393{
395 INT_PTR Ret = 0;
396
397 if (uMsg != WM_INITDIALOG)
398 {
400 }
401
402 switch (uMsg)
403 {
404 case WM_INITDIALOG:
406 This->hwndDlg = hwndDlg;
408
410 Ret = TRUE;
411 break;
412
413 case WM_COMMAND:
414 switch (LOWORD(wParam))
415 {
418 break;
419
420 case IDC_LISTALLMODES:
422 break;
423 }
424
425 break;
426
427 case WM_NOTIFY:
428 {
429 NMHDR *nmh = (NMHDR *)lParam;
430
431 switch (nmh->code)
432 {
433 case PSN_APPLY:
434 {
435 SetWindowLongPtr(hwndDlg,
438 Ret = TRUE;
439 break;
440 }
441
442 case PSN_RESET:
444 break;
445 }
446 break;
447 }
448 }
449
450 return Ret;
451}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static VOID InitDisplayAdapterDialog(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:291
static VOID ShowAdapterProperties(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:268
static VOID ShowListAllModes(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:244
static VOID ResetDisplayAdapterChanges(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:379
static LONG ApplyDisplayAdapterChanges(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:351
struct _DESKDISPLAYADAPTER * PDESKDISPLAYADAPTER
#define IDC_ADAPTERPROPERTIES
Definition: resource.h:7
#define IDC_LISTALLMODES
Definition: resource.h:13
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LOWORD(l)
Definition: pedump.c:82
#define PSN_APPLY
Definition: prsht.h:117
#define LPCPROPSHEETPAGE
Definition: prsht.h:391
#define PSN_RESET
Definition: prsht.h:118
#define WM_NOTIFY
Definition: richedit.h:61
UINT code
Definition: winuser.h:3158
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT_PTR
Definition: typedefs.h:64
#define DWLP_USER
Definition: winuser.h:871
#define WM_COMMAND
Definition: winuser.h:1739
#define WM_INITDIALOG
Definition: winuser.h:1738
#define DWLP_MSGRESULT
Definition: winuser.h:869

Referenced by IDeskDisplayAdapter_AddPages().

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  dwReason,
LPVOID  lpvReserved 
)

Definition at line 626 of file deskadp.c.

629{
630 switch (dwReason)
631 {
633 hInstance = hinstDLL;
635 break;
636 }
637
638 return TRUE;
639}
DWORD dwReason
Definition: misc.cpp:154
static HINSTANCE hInstance
Definition: deskadp.c:10
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85

◆ GetColorDescription()

static VOID GetColorDescription ( PDEVMODEW  lpDevMode,
LPTSTR  lpBuffer,
DWORD  dwBufferLen 
)
static

Definition at line 15 of file deskadp.c.

18{
19 UINT uid = 0;
20
21 switch (lpDevMode->dmBitsPerPel)
22 {
23 case 4:
24 uid = IDS_4BPP;
25 break;
26 case 8:
27 uid = IDS_8BPP;
28 break;
29 case 15:
30 uid = IDS_15BPP;
31 break;
32 case 16:
33 uid = IDS_16BPP;
34 break;
35 case 24:
36 uid = IDS_24BPP;
37 break;
38 case 32:
39 uid = IDS_32BPP;
40 break;
41 }
42
43 if (uid == 0 ||
45 uid,
47 dwBufferLen))
48 {
49 lpBuffer[0] = TEXT('\0');
50 }
51}
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define IDS_15BPP
Definition: resource.h:23
#define IDS_4BPP
Definition: resource.h:21
#define IDS_32BPP
Definition: resource.h:26
#define IDS_24BPP
Definition: resource.h:25
#define IDS_16BPP
Definition: resource.h:24
#define IDS_8BPP
Definition: resource.h:22
#define TEXT(s)
Definition: k32.h:26
static _In_ DWORD _Inout_ PDEVMODEA lpDevMode
Definition: dispmode.c:77
unsigned int UINT
Definition: ndis.h:50
DWORD dmBitsPerPel
Definition: wingdi.h:1595
#define LoadString
Definition: winuser.h:5818

Referenced by InitListAllModesDialog().

◆ GetRefreshRateDescription()

static VOID GetRefreshRateDescription ( PDEVMODEW  lpDevMode,
LPTSTR  lpBuffer,
DWORD  dwBufferLen 
)
static

Definition at line 54 of file deskadp.c.

57{
58 TCHAR szFormat[64];
59
61 {
65 dwBufferLen))
66 {
67 lpBuffer[0] = TEXT('\0');
68 }
69 }
70 else
71 {
74 szFormat,
75 sizeof(szFormat) / sizeof(szFormat[0])))
76 {
77 szFormat[0] = TEXT('\0');
78 }
79
81 dwBufferLen,
82 szFormat,
84 }
85}
#define IDS_DEFREFRESHRATE
Definition: resource.h:19
#define IDES_REFRESHRATEFMT
Definition: resource.h:20
DWORD dmDisplayFrequency
Definition: wingdi.h:1602
char TCHAR
Definition: xmlstorage.h:189
#define _sntprintf
Definition: xmlstorage.h:201

Referenced by InitListAllModesDialog().

◆ IDeskDisplayAdapter_AddPages()

HRESULT IDeskDisplayAdapter_AddPages ( PDESKDISPLAYADAPTER  This,
LPFNADDPROPSHEETPAGE  pfnAddPage,
LPARAM  lParam 
)

Definition at line 563 of file deskadp.c.

566{
567 HPROPSHEETPAGE hpsp;
568 PROPSHEETPAGE psp;
569
570 DPRINT1("IDeskDisplayAdapter::AddPages(%p,%p)\n", pfnAddPage, lParam);
571
572 psp.dwSize = sizeof(psp);
573 psp.dwFlags = PSP_DEFAULT;
574 psp.hInstance = hInstance;
575 psp.pszTemplate = MAKEINTRESOURCE(IDD_DISPLAYADAPTER);
576 psp.pfnDlgProc = DisplayAdapterDlgProc;
577 psp.lParam = (LPARAM)This;
578
579 hpsp = CreatePropertySheetPage(&psp);
580 if (hpsp != NULL && pfnAddPage(hpsp, lParam))
581 return S_OK;
582
583 return S_FALSE;
584}
#define DPRINT1
Definition: precomp.h:8
static INT_PTR CALLBACK DisplayAdapterDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: deskadp.c:389
#define IDD_DISPLAYADAPTER
Definition: resource.h:3
#define S_OK
Definition: intsafe.h:52
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define CreatePropertySheetPage
Definition: prsht.h:399
#define PSP_DEFAULT
Definition: prsht.h:22
#define PROPSHEETPAGE
Definition: prsht.h:389
LONG_PTR LPARAM
Definition: windef.h:208
#define S_FALSE
Definition: winerror.h:2357
#define MAKEINTRESOURCE
Definition: winuser.h:591

Referenced by IDeskDisplayAdapter_IShellPropSheetExt_AddPages().

◆ IDeskDisplayAdapter_AddRef()

ULONG IDeskDisplayAdapter_AddRef ( PDESKDISPLAYADAPTER  This)

Definition at line 476 of file deskadp.c.

477{
478 ULONG ret;
479
481 if (ret == 1)
483
484 return ret;
485}
#define InterlockedIncrement
Definition: armddk.h:53
DECLSPEC_HIDDEN LONG dll_refs
Definition: devenum_main.c:28
int32_t * PLONG
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
int ret

Referenced by IDeskDisplayAdapter_IClassFactory_AddRef(), IDeskDisplayAdapter_InitIface(), IDeskDisplayAdapter_IShellExtInit_AddRef(), IDeskDisplayAdapter_IShellPropSheetExt_AddRef(), and IDeskDisplayAdapter_QueryInterface().

◆ IDeskDisplayAdapter_Constructor()

HRESULT IDeskDisplayAdapter_Constructor ( REFIID  riid,
LPVOID ppv 
)

Definition at line 597 of file deskadp.c.

599{
601 HRESULT hRet = E_OUTOFMEMORY;
602
603 DPRINT1("IDeskDisplayAdapter::Constructor(%p,%p)\n", riid, ppv);
604
606 0,
607 sizeof(*This));
608 if (This != NULL)
609 {
611 sizeof(*This));
612
614
616 riid,
617 ppv);
618 if (!SUCCEEDED(hRet))
620 }
621
622 return hRet;
623}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
ULONG IDeskDisplayAdapter_Release(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:488
HRESULT STDMETHODCALLTYPE IDeskDisplayAdapter_QueryInterface(PDESKDISPLAYADAPTER This, REFIID iid, PVOID *pvObject)
Definition: deskadp.c:507
VOID IDeskDisplayAdapter_InitIface(PDESKDISPLAYADAPTER This)
Definition: shxiface.c:176
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define ZeroMemory
Definition: winbase.h:1712

Referenced by DllGetClassObject(), and IDeskDisplayAdapter_IClassFactory_CreateInstance().

◆ IDeskDisplayAdapter_Destroy()

static VOID IDeskDisplayAdapter_Destroy ( PDESKDISPLAYADAPTER  This)
static

Definition at line 454 of file deskadp.c.

455{
456 if (This->pdtobj != NULL)
457 {
458 IDataObject_Release(This->pdtobj);
459 This->pdtobj = NULL;
460 }
461
462 if (This->DeskExtInterface != NULL)
463 {
464 LocalFree((HLOCAL)This->DeskExtInterface);
465 This->DeskExtInterface = NULL;
466 }
467
468 if (This->lpDeviceId != NULL)
469 {
470 LocalFree((HLOCAL)This->lpDeviceId);
471 This->lpDeviceId = NULL;
472 }
473}
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594

Referenced by IDeskDisplayAdapter_Release().

◆ IDeskDisplayAdapter_Initialize()

HRESULT IDeskDisplayAdapter_Initialize ( PDESKDISPLAYADAPTER  This,
LPCITEMIDLIST  pidlFolder,
IDataObject pdtobj,
HKEY  hkeyProgID 
)

Definition at line 541 of file deskadp.c.

545{
546 DPRINT1("IDeskDisplayAdapter::Initialize(%p,%p,%p)\n", pidlFolder, pdtobj, hkeyProgID);
547
548 if (pdtobj != NULL)
549 {
550 IDataObject_AddRef(pdtobj);
551 This->pdtobj = pdtobj;
552
553 /* Get a copy of the desk.cpl extension interface */
554 This->DeskExtInterface = QueryDeskCplExtInterface(This->pdtobj);
555 if (This->DeskExtInterface != NULL)
556 return S_OK;
557 }
558
559 return S_FALSE;
560}
static __inline PDESK_EXT_INTERFACE QueryDeskCplExtInterface(IDataObject *pdo)
Definition: deskcplx.h:48

Referenced by IDeskDisplayAdapter_IShellExtInit_Initialize().

◆ IDeskDisplayAdapter_QueryInterface()

HRESULT STDMETHODCALLTYPE IDeskDisplayAdapter_QueryInterface ( PDESKDISPLAYADAPTER  This,
REFIID  iid,
PVOID pvObject 
)

Definition at line 507 of file deskadp.c.

510{
511 *pvObject = NULL;
512
513 if (IsEqualIID(iid,
514 &IID_IShellPropSheetExt) ||
515 IsEqualIID(iid,
516 &IID_IUnknown))
517 {
519 }
520 else if (IsEqualIID(iid,
521 &IID_IShellExtInit))
522 {
524 }
525 else if (IsEqualIID(iid,
527 {
529 }
530 else
531 {
532 DPRINT1("IDeskDisplayAdapter::QueryInterface(%p,%p): E_NOINTERFACE\n", iid, pvObject);
533 return E_NOINTERFACE;
534 }
535
537 return S_OK;
538}
const GUID IID_IUnknown
const GUID IID_IClassFactory
ULONG IDeskDisplayAdapter_AddRef(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:476
#define impl_to_interface(impl, iface)
Definition: dwnl.c:35
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:2364

Referenced by IDeskDisplayAdapter_Constructor(), IDeskDisplayAdapter_IClassFactory_QueryInterface(), IDeskDisplayAdapter_IShellExtInit_QueryInterface(), and IDeskDisplayAdapter_IShellPropSheetExt_QueryInterface().

◆ IDeskDisplayAdapter_Release()

ULONG IDeskDisplayAdapter_Release ( PDESKDISPLAYADAPTER  This)

Definition at line 488 of file deskadp.c.

489{
490 ULONG ret;
491
493 if (ret == 0)
494 {
497
499 0,
500 This);
501 }
502
503 return ret;
504}
#define InterlockedDecrement
Definition: armddk.h:52
static VOID IDeskDisplayAdapter_Destroy(PDESKDISPLAYADAPTER This)
Definition: deskadp.c:454
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by IDeskDisplayAdapter_Constructor(), IDeskDisplayAdapter_IClassFactory_Release(), IDeskDisplayAdapter_IShellExtInit_Release(), and IDeskDisplayAdapter_IShellPropSheetExt_Release().

◆ IDeskDisplayAdapter_ReplacePage()

HRESULT IDeskDisplayAdapter_ReplacePage ( PDESKDISPLAYADAPTER  This,
EXPPS  uPageID,
LPFNADDPROPSHEETPAGE  pfnReplacePage,
LPARAM  lParam 
)

Definition at line 587 of file deskadp.c.

591{
592 DPRINT1("IDeskDisplayAdapter::ReplacePage(%u,%p,%p)\n", uPageID, pfnReplacePage, lParam);
593 return E_NOTIMPL;
594}
#define E_NOTIMPL
Definition: ddrawi.h:99

Referenced by IDeskDisplayAdapter_IShellPropSheetExt_ReplacePage().

◆ InitDisplayAdapterDialog()

static VOID InitDisplayAdapterDialog ( PDESKDISPLAYADAPTER  This)
static

Definition at line 291 of file deskadp.c.

292{
293 LPTSTR lpAdapterName;
294 TCHAR lpNA[64];
295
296 This->lpDeviceId = QueryDeskCplString(This->pdtobj,
300 This->lpDeviceId != NULL && This->lpDeviceId[0] != TEXT('\0'));
301 lpAdapterName = QueryDeskCplString(This->pdtobj,
303 if (lpAdapterName != NULL)
304 {
305 SetDlgItemText(This->hwndDlg,
307 lpAdapterName);
308
309 LocalFree((HLOCAL)lpAdapterName);
310 }
311
314 lpNA,
315 _countof(lpNA));
316
317 if (This->DeskExtInterface != NULL)
318 {
319 SetDlgItemTextW(This->hwndDlg,
321 *(This->DeskExtInterface->ChipType) ? This->DeskExtInterface->ChipType : lpNA);
322 SetDlgItemTextW(This->hwndDlg,
324 *(This->DeskExtInterface->DacType) ? This->DeskExtInterface->DacType : lpNA);
325 SetDlgItemTextW(This->hwndDlg,
327 *(This->DeskExtInterface->MemorySize) ? This->DeskExtInterface->MemorySize : lpNA);
328 SetDlgItemTextW(This->hwndDlg,
330 *(This->DeskExtInterface->AdapterString) ? This->DeskExtInterface->AdapterString : lpNA);
331 SetDlgItemTextW(This->hwndDlg,
333 *(This->DeskExtInterface->BiosString) ? This->DeskExtInterface->BiosString : lpNA);
334
335 This->lpDevModeOnInit = This->DeskExtInterface->GetCurrentMode(This->DeskExtInterface->Context);
336 }
337 else
338 {
339 This->lpDevModeOnInit = NULL;
340 SetDlgItemTextW(This->hwndDlg, IDC_CHIPTYPE, lpNA);
341 SetDlgItemTextW(This->hwndDlg, IDC_DACTYPE, lpNA);
342 SetDlgItemTextW(This->hwndDlg, IDC_MEMORYSIZE, lpNA);
343 SetDlgItemTextW(This->hwndDlg, IDC_ADAPTERSTRING, lpNA);
345 }
346
347 This->lpSelDevMode = This->lpDevModeOnInit;
348}
static __inline LPTSTR QueryDeskCplString(IDataObject *pdo, UINT cfFormat)
Definition: deskcplx.h:84
#define DESK_EXT_DISPLAYNAME
Definition: deskcplx.h:9
#define DESK_EXT_DISPLAYID
Definition: deskcplx.h:10
#define IDC_ADAPTERSTRING
Definition: resource.h:11
#define IDS_NOTAVAIL
Definition: resource.h:27
#define IDC_BIOSINFORMATION
Definition: resource.h:12
#define IDC_CHIPTYPE
Definition: resource.h:8
#define IDC_ADAPTERNAME
Definition: resource.h:6
#define IDC_MEMORYSIZE
Definition: resource.h:10
#define IDC_DACTYPE
Definition: resource.h:9
#define _countof(array)
Definition: sndvol32.h:68
#define RegisterClipboardFormat
Definition: winuser.h:5837
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define SetDlgItemText
Definition: winuser.h:5848
CHAR * LPTSTR
Definition: xmlstorage.h:192

Referenced by DisplayAdapterDlgProc().

◆ InitListAllModesDialog()

static VOID InitListAllModesDialog ( PDESKDISPLAYADAPTER  This,
HWND  hwndListAllModesDlg 
)
static

Definition at line 88 of file deskadp.c.

90{
91 TCHAR szFormat[64], szBuffer[64], szColors[64], szRefreshRate[64];
92 PDEVMODEW lpDevMode, lpCurrentDevMode;
93 DWORD dwIndex = 0;
94 INT i;
95
96 if (This->DeskExtInterface != NULL)
97 {
100 szFormat,
101 sizeof(szFormat) / sizeof(szFormat[0])))
102 {
103 szFormat[0] = TEXT('\0');
104 }
105
106 lpCurrentDevMode = This->DeskExtInterface->GetCurrentMode(This->DeskExtInterface->Context);
107
108 do
109 {
110 lpDevMode = This->DeskExtInterface->EnumAllModes(This->DeskExtInterface->Context,
111 dwIndex++);
112 if (lpDevMode != NULL)
113 {
115 szColors,
116 sizeof(szColors) / sizeof(szColors[0]));
117
119 szRefreshRate,
120 sizeof(szRefreshRate) / sizeof(szRefreshRate[0]));
121
122 _sntprintf(szBuffer,
123 sizeof(szBuffer) / sizeof(szBuffer[0]),
124 szFormat,
127 szColors,
128 szRefreshRate);
129
130 i = (INT)SendDlgItemMessage(hwndListAllModesDlg,
133 0,
134 (LPARAM)szBuffer);
135 if (i >= 0)
136 {
137 SendDlgItemMessage(hwndListAllModesDlg,
140 (WPARAM)i,
142
143 if (lpDevMode == lpCurrentDevMode)
144 {
145 SendDlgItemMessage(hwndListAllModesDlg,
148 (WPARAM)i,
149 0);
150 }
151 }
152 }
153
154 } while (lpDevMode != NULL);
155 }
156}
static VOID GetRefreshRateDescription(PDEVMODEW lpDevMode, LPTSTR lpBuffer, DWORD dwBufferLen)
Definition: deskadp.c:54
static VOID GetColorDescription(PDEVMODEW lpDevMode, LPTSTR lpBuffer, DWORD dwBufferLen)
Definition: deskadp.c:15
#define IDS_MODEFMT
Definition: resource.h:18
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dmPelsWidth
Definition: wingdi.h:1596
DWORD dmPelsHeight
Definition: wingdi.h:1597
#define LB_ADDSTRING
Definition: winuser.h:2030
#define LB_SETITEMDATA
Definition: winuser.h:2064
#define LB_SETCURSEL
Definition: winuser.h:2062

Referenced by ListAllModesDlgProc().

◆ ListAllModesDlgProc()

static INT_PTR CALLBACK ListAllModesDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 191 of file deskadp.c.

195{
197 INT_PTR Ret = 0;
198
199 if (uMsg != WM_INITDIALOG)
200 {
202 }
203
204 switch (uMsg)
205 {
206 case WM_INITDIALOG:
209
211 hwndDlg);
212 Ret = TRUE;
213 break;
214
215 case WM_COMMAND:
216 switch (LOWORD(wParam))
217 {
218 case IDOK:
220 hwndDlg))
221 {
222 EndDialog(hwndDlg,
223 IDOK);
224 }
225 break;
226
227 case IDCANCEL:
228 EndDialog(hwndDlg,
229 IDCANCEL);
230 break;
231 }
232 break;
233
234 case WM_CLOSE:
235 EndDialog(hwndDlg,
236 IDCANCEL);
237 break;
238 }
239
240 return Ret;
241}
static VOID InitListAllModesDialog(PDESKDISPLAYADAPTER This, HWND hwndListAllModesDlg)
Definition: deskadp.c:88
static BOOL ChangeSelectedMode(PDESKDISPLAYADAPTER This, HWND hwndListAllModesDlg)
Definition: deskadp.c:159
#define WM_CLOSE
Definition: winuser.h:1620
#define IDCANCEL
Definition: winuser.h:830
#define IDOK
Definition: winuser.h:829
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by ShowListAllModes().

◆ ResetDisplayAdapterChanges()

static VOID ResetDisplayAdapterChanges ( PDESKDISPLAYADAPTER  This)
static

Definition at line 379 of file deskadp.c.

380{
381 if (This->DeskExtInterface != NULL && This->lpDevModeOnInit != NULL)
382 {
383 This->DeskExtInterface->SetCurrentMode(This->DeskExtInterface->Context,
384 This->lpDevModeOnInit);
385 }
386}

Referenced by DisplayAdapterDlgProc().

◆ ShowAdapterProperties()

static VOID ShowAdapterProperties ( PDESKDISPLAYADAPTER  This)
static

Definition at line 268 of file deskadp.c.

269{
270 HMODULE hDevMgr;
271 PDEVICEPROPERTIESW pDevicePropertiesW;
272
273 hDevMgr = LoadLibrary(TEXT("devmgr.dll"));
274 if (hDevMgr != NULL)
275 {
276 pDevicePropertiesW = (PDEVICEPROPERTIESW)GetProcAddress(hDevMgr,
277 "DevicePropertiesW");
278 if (pDevicePropertiesW != NULL)
279 {
280 pDevicePropertiesW(This->hwndDlg,
281 NULL,
282 This->lpDeviceId,
283 FALSE);
284 }
285
286 FreeLibrary(hDevMgr);
287 }
288}
INT_PTR(WINAPI * PDEVICEPROPERTIESW)(HWND, LPCWSTR, LPCWSTR, BOOL)
Definition: deskadp.c:12
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define LoadLibrary
Definition: winbase.h:3797

Referenced by DisplayAdapterDlgProc().

◆ ShowListAllModes()

static VOID ShowListAllModes ( PDESKDISPLAYADAPTER  This)
static

Definition at line 244 of file deskadp.c.

245{
246 PDEVMODEW lpPrevSel;
247
248 lpPrevSel = This->lpSelDevMode;
249
250 if (This->DeskExtInterface != NULL &&
253 This->hwndDlg,
255 (LPARAM)This) == IDOK)
256 {
257 if (lpPrevSel != This->lpSelDevMode)
258 {
260 This->hwndDlg);
261 This->DeskExtInterface->SetCurrentMode(This->DeskExtInterface->Context,
262 This->lpSelDevMode);
263 }
264 }
265}
static INT_PTR CALLBACK ListAllModesDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: deskadp.c:191
#define IDD_LISTALLMODES
Definition: resource.h:4
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define DialogBoxParam
Definition: winuser.h:5763

Referenced by DisplayAdapterDlgProc().

Variable Documentation

◆ hInstance