ReactOS 0.4.15-dev-8419-g7f0e8a3
deskmon.c
Go to the documentation of this file.
1#include "precomp.h"
2
3#include <tchar.h>
4#include <winreg.h>
5#include <cfgmgr32.h>
6
7#define NDEBUG
8#include <debug.h>
9
10#include "resource.h"
11
15
16#ifdef UNICODE
18#define FUNC_DEVICEPROPERTIES "DevicePropertiesW"
19#else
21#define FUNC_DEVICEPROPERTIES "DevicePropertiesA"
22#endif
23
43static LPTSTR
45{
46 CONFIGRET cr;
47 DEVINST diChild;
48 TCHAR szProperty[256];
50 LPTSTR lpDevInstId = NULL;
51
52 if (!bFoundAdapter)
53 return NULL;
54
55 /* Look for child monitor devices of selected video adapter */
56 cr = CM_Get_Child(&diChild, diAdapter, 0);
57 if (cr != CR_SUCCESS)
58 {
59 DPRINT1("CM_Get_Child failed: %d\n", cr);
60 return NULL;
61 }
62
63 do
64 {
65 /* Get Hardware ID for each of them */
66 dwSize = sizeof(szProperty) - sizeof(TCHAR);
67
70 NULL,
71 szProperty,
72 &dwSize,
73 0);
74 if (cr != CR_SUCCESS)
75 {
76 DPRINT1("CM_Get_DevNode_Registry_Property failed: %d\n", cr);
77 continue;
78 }
79
80 /* Concatenate with driver key */
81 _tcscat(szProperty, TEXT("\\"));
82 dwSize = sizeof(szProperty) - sizeof(TCHAR);
83 dwSize -= _tcslen(szProperty) * sizeof(TCHAR);
84
87 NULL,
88 szProperty + _tcslen(szProperty),
89 &dwSize,
90 0);
91 if (cr != CR_SUCCESS)
92 {
93 DPRINT1("CM_Get_DevNode_Registry_Property failed: %d\n", cr);
94 continue;
95 }
96
97 /* If the strings match, this is our monitor device node */
98 if (_tcscmp(szProperty, lpDeviceID) == 0)
99 {
101 diChild,
102 0);
103 if (cr != CR_SUCCESS)
104 {
105 DPRINT1("CM_Get_Device_ID_Size failed: %d\n", cr);
106 break;
107 }
108
109 lpDevInstId = LocalAlloc(LMEM_FIXED,
110 (dwSize + 1) * sizeof(TCHAR));
111 if (lpDevInstId == NULL)
112 {
113 DPRINT1("LocalAlloc failed\n");
114 break;
115 }
116
117 cr = CM_Get_Device_ID(diChild,
118 lpDevInstId,
119 dwSize + 1,
120 0);
121 if (cr != CR_SUCCESS)
122 {
123 DPRINT1("CM_Get_Device_ID failed: %d\n", cr);
124 LocalFree((HLOCAL)lpDevInstId);
125 lpDevInstId = NULL;
126 }
127
128 break;
129 }
130 } while (CM_Get_Sibling(&diChild, diChild, 0) == CR_SUCCESS);
131
132 return lpDevInstId;
133}
134
135static VOID
137{
138 HMODULE hDevMgr;
139 PDEVICEPROPERTIES pDeviceProperties;
140 LPTSTR lpDevInstID;
141
142 if (This->SelMonitor != NULL)
143 {
144 lpDevInstID = GetMonitorDevInstID(This->SelMonitor->dd.DeviceID);
145 if (lpDevInstID != NULL)
146 {
147 hDevMgr = LoadLibrary(TEXT("devmgr.dll"));
148 if (hDevMgr != NULL)
149 {
150 pDeviceProperties = (PDEVICEPROPERTIES)GetProcAddress(hDevMgr,
152 if (pDeviceProperties != NULL)
153 {
154 pDeviceProperties(This->hwndDlg,
155 NULL,
156 lpDevInstID,
157 FALSE);
158 }
159
160 FreeLibrary(hDevMgr);
161 }
162
163 LocalFree((HLOCAL)lpDevInstID);
164 }
165 }
166}
167
168static VOID
170{
171 INT i;
172 LPTSTR lpDevInstID = NULL;
173
174 if (This->dwMonitorCount > 1)
175 {
176 This->SelMonitor = NULL;
177
178 i = (INT)SendDlgItemMessage(This->hwndDlg,
181 0,
182 0);
183 if (i >= 0)
184 {
185 This->SelMonitor = (PDESKMONINFO)SendDlgItemMessage(This->hwndDlg,
188 (WPARAM)i,
189 0);
190 }
191 }
192 else
193 This->SelMonitor = This->Monitors;
194
195 if (This->SelMonitor != NULL)
196 lpDevInstID = GetMonitorDevInstID(This->SelMonitor->dd.DeviceID);
197
200 lpDevInstID != NULL && lpDevInstID[0] != TEXT('\0'));
201
202 if (lpDevInstID != NULL)
203 LocalFree((HLOCAL)lpDevInstID);
204}
205
206static VOID
208{
211 This->bModesPruned && !This->bKeyIsReadOnly);
212 CheckDlgButton(This->hwndDlg,
214 (This->bModesPruned && This->bPruningOn) ? BST_CHECKED : BST_UNCHECKED);
215}
216
217static VOID
219{
220 BOOL bModesPruned = FALSE, bKeyIsReadOnly = FALSE, bPruningOn = FALSE;
221
222 if (This->DeskExtInterface != NULL)
223 {
224 This->DeskExtInterface->GetPruningMode(This->DeskExtInterface->Context,
225 &bModesPruned,
226 &bKeyIsReadOnly,
227 &bPruningOn);
228 }
229
230 /* Check the boolean values against zero before assigning it to the bitfields! */
231 This->bModesPruned = (bModesPruned != FALSE);
232 This->bKeyIsReadOnly = (bKeyIsReadOnly != FALSE);
233 This->bPruningOn = (bPruningOn != FALSE);
234
236}
237
238static VOID
240{
241 PDEVMODEW lpCurrentMode, lpMode;
242 TCHAR szBuffer[64];
243 DWORD dwIndex;
244 INT i;
245 BOOL bHasDef = FALSE;
246 BOOL bAdded = FALSE;
247
248 /* Fill the refresh rate combo box */
249 SendDlgItemMessage(This->hwndDlg,
252 0,
253 0);
254
255 lpCurrentMode = This->DeskExtInterface->GetCurrentMode(This->DeskExtInterface->Context);
256 dwIndex = 0;
257
258 do
259 {
260 lpMode = This->DeskExtInterface->EnumAllModes(This->DeskExtInterface->Context,
261 dwIndex++);
262 if (lpMode != NULL &&
263 lpMode->dmBitsPerPel == lpCurrentMode->dmBitsPerPel &&
264 lpMode->dmPelsWidth == lpCurrentMode->dmPelsWidth &&
265 lpMode->dmPelsHeight == lpCurrentMode->dmPelsHeight)
266 {
267 /* We're only interested in refresh rates for the current resolution and color depth */
268
269 if (lpMode->dmDisplayFrequency <= 1)
270 {
271 /* Default hardware frequency */
272 if (bHasDef)
273 continue;
274
275 bHasDef = TRUE;
276
279 szBuffer,
280 sizeof(szBuffer) / sizeof(szBuffer[0])))
281 {
282 szBuffer[0] = TEXT('\0');
283 }
284 }
285 else
286 {
287 TCHAR szFmt[64];
288
291 szFmt,
292 sizeof(szFmt) / sizeof(szFmt[0])))
293 {
294 szFmt[0] = TEXT('\0');
295 }
296
297 _sntprintf(szBuffer,
298 sizeof(szBuffer) / sizeof(szBuffer[0]),
299 szFmt,
300 lpMode->dmDisplayFrequency);
301 }
302
303 i = (INT)SendDlgItemMessage(This->hwndDlg,
306 0,
307 (LPARAM)szBuffer);
308 if (i >= 0)
309 {
310 bAdded = TRUE;
311
312 SendDlgItemMessage(This->hwndDlg,
315 (WPARAM)i,
316 (LPARAM)lpMode);
317
318 if (lpMode->dmDisplayFrequency == lpCurrentMode->dmDisplayFrequency)
319 {
320 SendDlgItemMessage(This->hwndDlg,
323 (WPARAM)i,
324 0);
325 }
326 }
327 }
328
329 } while (lpMode != NULL);
330
333 bAdded);
336 bAdded);
339 bAdded);
340
342}
343
344static VOID
346{
347 PDESKMONINFO pmi, pminext, *pmilink;
348 LPTSTR lpDeviceId;
349 CONFIGRET cr;
351 BOOL bRet;
352 INT i;
353 DWORD dwIndex;
354
355 /* Free all allocated monitors */
356 pmi = This->Monitors;
357 This->Monitors = NULL;
358 while (pmi != NULL)
359 {
360 pminext = pmi->Next;
361 LocalFree((HLOCAL)pmi);
362 pmi = pminext;
363 }
364
365 This->SelMonitor = NULL;
366 This->dwMonitorCount = 0;
367
369 lpDeviceId = QueryDeskCplString(This->pdtobj,
371
372 if (lpDeviceId != NULL && lpDeviceId[0] != TEXT('\0'))
373 {
375 lpDeviceId,
377 bFoundAdapter = (cr == CR_SUCCESS);
378
379 if (!bFoundAdapter)
380 DPRINT1("CM_Locate_DevNode failed: %d\n", cr);
381 }
382
383 if (This->lpDisplayDevice != NULL)
384 LocalFree((HLOCAL)This->lpDisplayDevice);
385
386 This->lpDisplayDevice = QueryDeskCplString(This->pdtobj,
388
389 if (This->DeskExtInterface != NULL)
390 {
391 if (This->lpDisplayDevice != NULL)
392 {
393 /* Enumerate all monitors */
394 dwIndex = 0;
395 pmilink = &This->Monitors;
396
397 do
398 {
399 dd.cb = sizeof(dd);
400 bRet = EnumDisplayDevices(This->lpDisplayDevice,
401 dwIndex++,
402 &dd,
403 0);
404 if (bRet)
405 {
407 sizeof(*pmi));
408 if (pmi != NULL)
409 {
410 CopyMemory(&pmi->dd,
411 &dd,
412 sizeof(dd));
413 pmi->Next = NULL;
414 *pmilink = pmi;
415 pmilink = &pmi->Next;
416
417 This->dwMonitorCount++;
418 }
419 }
420 } while (bRet);
421 }
422
423 This->lpDevModeOnInit = This->DeskExtInterface->GetCurrentMode(This->DeskExtInterface->Context);
424 }
425 else
426 This->lpDevModeOnInit = NULL;
427
428 This->lpSelDevMode = This->lpDevModeOnInit;
429
430 /* Setup the UI depending on how many monitors are attached */
431 if (This->dwMonitorCount == 0)
432 {
433 LPTSTR lpMonitorName;
434
435 /* This is a fallback, let's hope that desk.cpl can provide us with a monitor name */
436 lpMonitorName = QueryDeskCplString(This->pdtobj,
438
439 SetDlgItemText(This->hwndDlg,
441 lpMonitorName);
442
443 if (lpMonitorName != NULL)
444 LocalFree((HLOCAL)lpMonitorName);
445 }
446 else if (This->dwMonitorCount == 1)
447 {
448 This->SelMonitor = This->Monitors;
449 SetDlgItemText(This->hwndDlg,
451 This->Monitors->dd.DeviceString);
452 }
453 else
454 {
455 SendDlgItemMessage(This->hwndDlg,
458 0,
459 0);
460
461 pmi = This->Monitors;
462 while (pmi != NULL)
463 {
464 i = (INT)SendDlgItemMessage(This->hwndDlg,
467 0,
468 (LPARAM)pmi->dd.DeviceString);
469 if (i >= 0)
470 {
471 SendDlgItemMessage(This->hwndDlg,
474 (WPARAM)i,
475 (LPARAM)pmi);
476
477 if (This->SelMonitor == NULL)
478 {
479 SendDlgItemMessage(This->hwndDlg,
482 (WPARAM)i,
483 0);
484
485 This->SelMonitor = pmi;
486 }
487 }
488
489 pmi = pmi->Next;
490 }
491 }
492
493 /* Show/Hide controls */
494 ShowWindow(GetDlgItem(This->hwndDlg,
496 (This->dwMonitorCount <= 1 ? SW_SHOW : SW_HIDE));
497 ShowWindow(GetDlgItem(This->hwndDlg,
499 (This->dwMonitorCount > 1 ? SW_SHOW : SW_HIDE));
500
503}
504
505static VOID
507{
508 BOOL bPruningOn;
509
510 if (This->DeskExtInterface != NULL && This->bModesPruned && !This->bKeyIsReadOnly)
511 {
512 bPruningOn = IsDlgButtonChecked(This->hwndDlg,
514
515 if (bPruningOn != This->bPruningOn)
516 {
517 /* Tell desk.cpl to turn on/off pruning mode */
518 This->bPruningOn = bPruningOn;
519 This->DeskExtInterface->SetPruningMode(This->DeskExtInterface->Context,
520 bPruningOn);
521
522 /* Fill the refresh rate combobox again, we now receive a filtered
523 or unfiltered device mode list from desk.cpl (depending on whether
524 pruning is active or not) */
526
528 This->hwndDlg);
529 }
530 }
531}
532
533static VOID
535{
536 PDEVMODEW lpCurrentDevMode;
537 INT i;
538
539 if (This->DeskExtInterface != NULL)
540 {
541 i = (INT)SendDlgItemMessage(This->hwndDlg,
544 0,
545 0);
546 if (i >= 0)
547 {
548 lpCurrentDevMode = This->lpSelDevMode;
549 This->lpSelDevMode = (PDEVMODEW)SendDlgItemMessage(This->hwndDlg,
552 (WPARAM)i,
553 0);
554
555 if (This->lpSelDevMode != NULL && This->lpSelDevMode != lpCurrentDevMode)
556 {
557 This->DeskExtInterface->SetCurrentMode(This->DeskExtInterface->Context,
558 This->lpSelDevMode);
559
561
563 This->hwndDlg);
564 }
565 }
566 }
567}
568
569static LONG
571{
572 LONG lChangeRet;
573
574 if (This->DeskExtInterface != NULL)
575 {
576 /* Change the display settings through desk.cpl */
577 lChangeRet = DeskCplExtDisplaySaveSettings(This->DeskExtInterface,
578 This->hwndDlg);
579 if (lChangeRet == DISP_CHANGE_SUCCESSFUL)
580 {
581 /* Save the new mode */
582 This->lpDevModeOnInit = This->DeskExtInterface->GetCurrentMode(This->DeskExtInterface->Context);
583 This->lpSelDevMode = This->lpDevModeOnInit;
584 return PSNRET_NOERROR;
585 }
586 else if (lChangeRet == DISP_CHANGE_RESTART)
587 {
588 /* Notify desk.cpl that the user needs to reboot */
590 return PSNRET_NOERROR;
591 }
592 }
593
595
597}
598
599static VOID
601{
602 if (This->DeskExtInterface != NULL && This->lpDevModeOnInit != NULL)
603 {
604 This->DeskExtInterface->SetCurrentMode(This->DeskExtInterface->Context,
605 This->lpDevModeOnInit);
606 }
607}
608
609static INT_PTR CALLBACK
611 UINT uMsg,
614{
616 INT_PTR Ret = 0;
617
618 if (uMsg != WM_INITDIALOG)
619 {
621 }
622
623 switch (uMsg)
624 {
625 case WM_INITDIALOG:
627 This->hwndDlg = hwndDlg;
629
631 Ret = TRUE;
632 break;
633
634 case WM_COMMAND:
635 switch (LOWORD(wParam))
636 {
639 break;
640
641 case IDC_MONITORLIST:
644 break;
645
646 case IDC_PRUNINGCHECK:
647 if (HIWORD(wParam) == BN_CLICKED)
649 break;
650
651 case IDC_REFRESHRATE:
654 break;
655 }
656 break;
657
658 case WM_NOTIFY:
659 {
660 NMHDR *nmh = (NMHDR *)lParam;
661
662 switch (nmh->code)
663 {
664 case PSN_APPLY:
665 {
666 SetWindowLongPtr(hwndDlg,
669 Ret = TRUE;
670 break;
671 }
672
673 case PSN_RESET:
675 break;
676
677 case PSN_SETACTIVE:
679 break;
680 }
681 break;
682 }
683 }
684
685 return Ret;
686}
687
688static VOID
690{
691 PDESKMONINFO pmi, pminext;
692
693 if (This->pdtobj != NULL)
694 {
695 IDataObject_Release(This->pdtobj);
696 This->pdtobj = NULL;
697 }
698
699 if (This->DeskExtInterface != NULL)
700 {
701 LocalFree((HLOCAL)This->DeskExtInterface);
702 This->DeskExtInterface = NULL;
703 }
704
705 if (This->lpDisplayDevice != NULL)
706 {
707 LocalFree((HLOCAL)This->lpDisplayDevice);
708 This->lpDisplayDevice = NULL;
709 }
710
711 /* Free all monitors */
712 pmi = This->Monitors;
713 This->Monitors = NULL;
714 while (pmi != NULL)
715 {
716 pminext = pmi->Next;
717 LocalFree((HLOCAL)pmi);
718 pmi = pminext;
719 }
720}
721
722ULONG
724{
725 ULONG ret;
726
728 if (ret == 1)
730
731 return ret;
732}
733
734ULONG
736{
737 ULONG ret;
738
740 if (ret == 0)
741 {
744
746 0,
747 This);
748 }
749
750 return ret;
751}
752
755 REFIID iid,
756 PVOID *pvObject)
757{
758 *pvObject = NULL;
759
760 if (IsEqualIID(iid,
761 &IID_IShellPropSheetExt) ||
762 IsEqualIID(iid,
763 &IID_IUnknown))
764 {
766 }
767 else if (IsEqualIID(iid,
768 &IID_IShellExtInit))
769 {
771 }
772 else if (IsEqualIID(iid,
774 {
776 }
777 else
778 {
779 DPRINT1("IDeskMonitor::QueryInterface(%p,%p): E_NOINTERFACE\n", iid, pvObject);
780 return E_NOINTERFACE;
781 }
782
784 return S_OK;
785}
786
789 LPCITEMIDLIST pidlFolder,
790 IDataObject *pdtobj,
791 HKEY hkeyProgID)
792{
793 DPRINT1("IDeskMonitor::Initialize(%p,%p,%p)\n", pidlFolder, pdtobj, hkeyProgID);
794
795 if (pdtobj != NULL)
796 {
797 IDataObject_AddRef(pdtobj);
798 This->pdtobj = pdtobj;
799
800 /* Get a copy of the desk.cpl extension interface */
801 This->DeskExtInterface = QueryDeskCplExtInterface(This->pdtobj);
802 if (This->DeskExtInterface != NULL)
803 return S_OK;
804 }
805
806 return S_FALSE;
807}
808
811 LPFNADDPROPSHEETPAGE pfnAddPage,
813{
814 HPROPSHEETPAGE hpsp;
815 PROPSHEETPAGE psp;
816
817 DPRINT1("IDeskMonitor::AddPages(%p,%p)\n", pfnAddPage, lParam);
818
819 psp.dwSize = sizeof(psp);
820 psp.dwFlags = PSP_DEFAULT;
821 psp.hInstance = hInstance;
822 psp.pszTemplate = MAKEINTRESOURCE(IDD_MONITOR);
823 psp.pfnDlgProc = MonitorDlgProc;
824 psp.lParam = (LPARAM)This;
825
826 hpsp = CreatePropertySheetPage(&psp);
827 if (hpsp != NULL && pfnAddPage(hpsp, lParam))
828 return S_OK;
829
830 return S_FALSE;
831}
832
835 EXPPS uPageID,
836 LPFNADDPROPSHEETPAGE pfnReplacePage,
838{
839 DPRINT1("IDeskMonitor::ReplacePage(%u,%p,%p)\n", uPageID, pfnReplacePage, lParam);
840 return E_NOTIMPL;
841}
842
845 LPVOID *ppv)
846{
848 HRESULT hRet = E_OUTOFMEMORY;
849
850 DPRINT1("IDeskMonitor::Constructor(%p,%p)\n", riid, ppv);
851
853 0,
854 sizeof(*This));
855 if (This != NULL)
856 {
858 sizeof(*This));
859
861
863 riid,
864 ppv);
865 if (!SUCCEEDED(hRet))
867 }
868
869 return hRet;
870}
871
876{
877 switch (dwReason)
878 {
880 hInstance = hinstDLL;
882 break;
883 }
884
885 return TRUE;
886}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define DPRINT1
Definition: precomp.h:8
DWORD dwReason
Definition: misc.cpp:154
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
#define CM_Get_Device_ID
Definition: cfgmgr32.h:1565
#define CM_DRP_DRIVER
Definition: cfgmgr32.h:685
DWORD DEVINST
Definition: cfgmgr32.h:76
#define CM_Get_DevNode_Registry_Property
Definition: cfgmgr32.h:1733
#define CM_Locate_DevNode
Definition: cfgmgr32.h:2403
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define CM_DRP_HARDWAREID
Definition: cfgmgr32.h:677
#define CM_LOCATE_DEVNODE_NORMAL
Definition: cfgmgr32.h:760
CONFIGRET WINAPI CM_Get_Child(_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
Definition: cfgmgr.c:2629
CONFIGRET WINAPI CM_Get_Device_ID_Size(_Out_ PULONG pulLen, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
Definition: cfgmgr.c:4172
CONFIGRET WINAPI CM_Get_Sibling(_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
Definition: cfgmgr.c:5652
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
static __inline LONG DeskCplExtDisplaySaveSettings(PDESK_EXT_INTERFACE DeskExtInterface, HWND hwndDlg)
Definition: deskcplx.h:122
static __inline PDESK_EXT_INTERFACE QueryDeskCplExtInterface(IDataObject *pdo)
Definition: deskcplx.h:48
#define DESK_EXT_MONITORNAME
Definition: deskcplx.h:13
static __inline LPTSTR QueryDeskCplString(IDataObject *pdo, UINT cfFormat)
Definition: deskcplx.h:84
#define DESK_EXT_DISPLAYDEVICE
Definition: deskcplx.h:8
#define DESK_EXT_DISPLAYID
Definition: deskcplx.h:10
HRESULT IDeskMonitor_ReplacePage(PDESKMONITOR This, EXPPS uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam)
Definition: deskmon.c:834
static VOID UpdatePruningControls(PDESKMONITOR This)
Definition: deskmon.c:207
static LONG ApplyMonitorChanges(PDESKMONITOR This)
Definition: deskmon.c:570
static VOID IDeskMonitor_Destroy(PDESKMONITOR This)
Definition: deskmon.c:689
HRESULT IDeskMonitor_Initialize(PDESKMONITOR This, LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID)
Definition: deskmon.c:788
static LPTSTR GetMonitorDevInstID(LPCTSTR lpDeviceID)
Converts a Hardware ID (DeviceID from EnumDisplayDevices) to an unique Device Instance ID.
Definition: deskmon.c:44
static VOID GetPruningSettings(PDESKMONITOR This)
Definition: deskmon.c:218
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
Definition: deskmon.c:873
ULONG IDeskMonitor_Release(PDESKMONITOR This)
Definition: deskmon.c:735
static HINSTANCE hInstance
Definition: deskmon.c:12
static DEVINST diAdapter
Definition: deskmon.c:14
static INT_PTR CALLBACK MonitorDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: deskmon.c:610
static VOID ShowMonitorProperties(PDESKMONITOR This)
Definition: deskmon.c:136
HRESULT STDMETHODCALLTYPE IDeskMonitor_QueryInterface(PDESKMONITOR This, REFIID iid, PVOID *pvObject)
Definition: deskmon.c:754
HRESULT IDeskMonitor_Constructor(REFIID riid, LPVOID *ppv)
Definition: deskmon.c:844
ULONG IDeskMonitor_AddRef(PDESKMONITOR This)
Definition: deskmon.c:723
INT_PTR(WINAPI * PDEVICEPROPERTIES)(HWND, LPCSTR, LPCSTR, BOOL)
Definition: deskmon.c:20
static VOID UpdateRefreshRateSelection(PDESKMONITOR This)
Definition: deskmon.c:534
static VOID UpdatePruningSelection(PDESKMONITOR This)
Definition: deskmon.c:506
static VOID UpdateRefreshFrequencyList(PDESKMONITOR This)
Definition: deskmon.c:239
static VOID InitMonitorDialog(PDESKMONITOR This)
Definition: deskmon.c:345
#define FUNC_DEVICEPROPERTIES
Definition: deskmon.c:21
static VOID UpdateMonitorSelection(PDESKMONITOR This)
Definition: deskmon.c:169
static VOID ResetMonitorChanges(PDESKMONITOR This)
Definition: deskmon.c:600
static BOOL bFoundAdapter
Definition: deskmon.c:13
HRESULT IDeskMonitor_AddPages(PDESKMONITOR This, LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam)
Definition: deskmon.c:810
struct _DESKMONINFO * PDESKMONINFO
VOID IDeskMonitor_InitIface(PDESKMONITOR This)
Definition: shxiface.c:176
struct _DESKMONITOR * PDESKMONITOR
DECLSPEC_HIDDEN LONG dll_refs
Definition: devenum_main.c:28
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDD_MONITOR
Definition: resource.h:3
#define IDS_MONITORSETTINGSGROUP
Definition: resource.h:8
#define IDC_PRUNINGCHECK
Definition: resource.h:11
#define IDC_MONITORNAME
Definition: resource.h:5
#define IDC_MONITORPROPERTIES
Definition: resource.h:7
#define IDC_REFRESHRATE
Definition: resource.h:10
#define IDS_REFRESHRATELABEL
Definition: resource.h:9
#define IDS_USEDEFFRQUENCY
Definition: resource.h:14
#define IDS_FREQFMT
Definition: resource.h:15
#define IDC_MONITORLIST
Definition: resource.h:6
#define GetProcessHeap()
Definition: compat.h:736
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
HANDLE HWND
Definition: compat.h:19
#define GetProcAddress(x, y)
Definition: compat.h:753
#define HeapAlloc
Definition: compat.h:733
#define FreeLibrary(x)
Definition: compat.h:748
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define impl_to_interface(impl, iface)
Definition: dwnl.c:35
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
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
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define _tcscmp
Definition: tchar.h:1424
#define _tcscat
Definition: tchar.h:622
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define TEXT(s)
Definition: k32.h:26
static IN DWORD IN LPVOID lpvReserved
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define BOOL
Definition: nt_native.h:43
#define LOWORD(l)
Definition: pedump.c:82
long LONG
Definition: pedump.c:60
#define INT
Definition: polytest.cpp:20
#define PSNRET_INVALID_NOCHANGEPAGE
Definition: prsht.h:131
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define CreatePropertySheetPage
Definition: prsht.h:399
#define PSP_DEFAULT
Definition: prsht.h:22
#define PSN_APPLY
Definition: prsht.h:117
#define PSNRET_NOERROR
Definition: prsht.h:129
#define PropSheet_RestartWindows(d)
Definition: prsht.h:352
#define LPCPROPSHEETPAGE
Definition: prsht.h:391
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
Definition: prsht.h:327
#define PSN_RESET
Definition: prsht.h:118
#define PSN_SETACTIVE
Definition: prsht.h:115
#define PROPSHEETPAGE
Definition: prsht.h:389
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define WM_NOTIFY
Definition: richedit.h:61
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
struct _DESKMONINFO * Next
Definition: deskmon.h:6
DISPLAY_DEVICE dd
Definition: deskmon.h:5
CHAR DeviceString[128]
Definition: wingdi.h:2811
DWORD dmBitsPerPel
Definition: wingdi.h:1647
DWORD dmPelsWidth
Definition: wingdi.h:1648
DWORD dmPelsHeight
Definition: wingdi.h:1649
DWORD dmDisplayFrequency
Definition: wingdi.h:1654
UINT code
Definition: winuser.h:3159
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT_PTR
Definition: typedefs.h:64
int32_t INT
Definition: typedefs.h:58
int32_t * PLONG
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
int ret
#define ZeroMemory
Definition: winbase.h:1712
#define LoadLibrary
Definition: winbase.h:3862
#define CopyMemory
Definition: winbase.h:1710
#define LMEM_FIXED
Definition: winbase.h:368
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define E_NOINTERFACE
Definition: winerror.h:2364
struct _devicemodeW * PDEVMODEW
#define CB_SETITEMDATA
Definition: winuser.h:1966
#define SW_HIDE
Definition: winuser.h:768
#define LB_GETITEMDATA
Definition: winuser.h:2041
#define DWLP_USER
Definition: winuser.h:872
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define BST_UNCHECKED
Definition: winuser.h:199
#define WM_COMMAND
Definition: winuser.h:1740
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190
#define RegisterClipboardFormat
Definition: winuser.h:5847
#define CB_SETCURSEL
Definition: winuser.h:1961
#define CB_RESETCONTENT
Definition: winuser.h:1959
#define WM_INITDIALOG
Definition: winuser.h:1739
#define LB_ADDSTRING
Definition: winuser.h:2031
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define CBN_SELCHANGE
Definition: winuser.h:1979
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define LB_RESETCONTENT
Definition: winuser.h:2055
#define CB_ADDSTRING
Definition: winuser.h:1936
#define CB_GETITEMDATA
Definition: winuser.h:1950
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define LB_SETITEMDATA
Definition: winuser.h:2065
#define LBN_SELCHANGE
Definition: winuser.h:2075
#define LoadString
Definition: winuser.h:5828
#define DWLP_MSGRESULT
Definition: winuser.h:870
#define BN_CLICKED
Definition: winuser.h:1925
#define SW_SHOW
Definition: winuser.h:775
#define LB_SETCURSEL
Definition: winuser.h:2063
#define DISP_CHANGE_RESTART
Definition: winuser.h:191
#define LB_GETCURSEL
Definition: winuser.h:2039
#define CB_GETCURSEL
Definition: winuser.h:1943
#define SendDlgItemMessage
Definition: winuser.h:5851
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define SetDlgItemText
Definition: winuser.h:5858
#define BST_CHECKED
Definition: winuser.h:197
char TCHAR
Definition: xmlstorage.h:189
const char * LPCSTR
Definition: xmlstorage.h:183
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define _sntprintf
Definition: xmlstorage.h:201
CHAR * LPTSTR
Definition: xmlstorage.h:192
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define _tcslen
Definition: xmlstorage.h:198