ReactOS 0.4.16-dev-197-g92996da
settings.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Display Control Panel
4 * PURPOSE: Settings property page
5 * PROGRAMMERS: Trevor McCort (lycan359@gmail.com)
6 * Hervé Poussineau (hpoussin@reactos.org)
7 */
8
9#include "desk.h"
10
11typedef struct _SETTINGS_DATA
12{
19
20typedef struct _TIMEOUTDATA
21{
26
27static VOID
29{
30 TCHAR Buffer[64];
31 TCHAR Pixel[64];
33 HWND hwndMonSel;
35
36 LoadString(hApplet, IDS_PIXEL, Pixel, _countof(Pixel));
37 _stprintf(Buffer, Pixel, pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth, pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight, Pixel);
39
40 for (index = 0; index < pData->CurrentDisplayDevice->ResolutionsCount; index++)
41 {
42 if (pData->CurrentDisplayDevice->Resolutions[index].dmPelsWidth == pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth &&
43 pData->CurrentDisplayDevice->Resolutions[index].dmPelsHeight == pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight)
44 {
45 if (bUpdateThumb)
47 break;
48 }
49 }
50 if (LoadString(hApplet, (2900 + pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel), Buffer, _countof(Buffer)))
52
53 hwndMonSel = GetDlgItem(hwndDlg, IDC_SETTINGS_MONSEL);
54 index = (INT)SendMessage(hwndMonSel, MSLM_GETCURSEL, 0, 0);
55 if (index != (DWORD)-1 && SendMessage(hwndMonSel, MSLM_GETMONITORINFO, index, (LPARAM)&info))
56 {
57 info.Size.cx = pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth;
58 info.Size.cy = pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight;
60 }
61}
62
63static int
64CompareSettings(PSETTINGS_ENTRY Entry, DWORD dmPelsWidth, DWORD dmPelsHeight,
65 DWORD dmBitsPerPel, DWORD dmDisplayFrequency)
66{
67 if (Entry->dmPelsWidth == dmPelsWidth &&
68 Entry->dmPelsHeight == dmPelsHeight &&
69 Entry->dmBitsPerPel == dmBitsPerPel &&
70 Entry->dmDisplayFrequency == dmDisplayFrequency)
71 {
72 return 0;
73 }
74 else
75 if ((Entry->dmPelsWidth < dmPelsWidth) ||
76 (Entry->dmPelsWidth == dmPelsWidth && Entry->dmPelsHeight < dmPelsHeight) ||
77 (Entry->dmPelsWidth == dmPelsWidth && Entry->dmPelsHeight == dmPelsHeight &&
78 Entry->dmBitsPerPel < dmBitsPerPel))
79 {
80 return 1;
81 }
82 return -1;
83}
84
85static PSETTINGS_ENTRY
87{
89 DWORD NbSettings = 0;
90 DWORD iMode = 0;
91 DWORD dwFlags = 0;
93 HDC hDC;
94 PSETTINGS_ENTRY Current;
95 DWORD bpp, xres, yres;
96 DWORD curDispFreq;
97
98 /* Get current settings */
99 *CurrentSettings = NULL;
103 xres = GetDeviceCaps(hDC, HORZRES);
104 yres = GetDeviceCaps(hDC, VERTRES);
105 DeleteDC(hDC);
106
107 /* List all settings */
108 devmode.dmSize = (WORD)sizeof(devmode);
110
111 if (!EnumDisplaySettingsEx(DeviceName, ENUM_CURRENT_SETTINGS, &devmode, dwFlags))
112 return NULL;
113
114 curDispFreq = devmode.dmDisplayFrequency;
115
116 while (EnumDisplaySettingsEx(DeviceName, iMode, &devmode, dwFlags))
117 {
118 iMode++;
119
120 if (devmode.dmPelsWidth < 640 ||
121 devmode.dmPelsHeight < 480 ||
122 devmode.dmDisplayFrequency != curDispFreq ||
123 (devmode.dmBitsPerPel != 4 &&
124 devmode.dmBitsPerPel != 8 &&
125 devmode.dmBitsPerPel != 16 &&
126 devmode.dmBitsPerPel != 24 &&
127 devmode.dmBitsPerPel != 32))
128 {
129 continue;
130 }
131
132 Current = HeapAlloc(GetProcessHeap(), 0, sizeof(SETTINGS_ENTRY));
133 if (Current != NULL)
134 {
135 /* Sort resolutions by increasing height, and BPP */
136 PSETTINGS_ENTRY Previous = NULL;
142 while (Next != NULL &&
146 {
147 Previous = Next;
148 Next = Next->Flink;
149 }
150 Current->Blink = Previous;
151 Current->Flink = Next;
152 if (Previous == NULL)
153 Settings = Current;
154 else
155 Previous->Flink = Current;
156 if (Next != NULL)
157 Next->Blink = Current;
158 if (devmode.dmPelsWidth == xres && devmode.dmPelsHeight == yres && devmode.dmBitsPerPel == bpp)
159 {
160 *CurrentSettings = Current;
161 }
162 NbSettings++;
163 }
164 }
165
166 *pSettingsCount = NbSettings;
167 return Settings;
168}
169
170static BOOL
172{
173 PDISPLAY_DEVICE_ENTRY newEntry = NULL;
175 LPTSTR name = NULL;
176 LPTSTR key = NULL;
177 LPTSTR devid = NULL;
178 SIZE_T descriptionSize, nameSize, keySize, devidSize;
179 PSETTINGS_ENTRY Current;
180 DWORD ResolutionsCount = 1;
181 DWORD i;
182
184 if (!newEntry) goto ByeBye;
185
186 newEntry->Settings = GetPossibleSettings(DisplayDevice->DeviceName, &newEntry->SettingsCount, &newEntry->CurrentSettings);
187 if (!newEntry->Settings) goto ByeBye;
188
193
194 /* Count different resolutions */
195 for (Current = newEntry->Settings; Current != NULL; Current = Current->Flink)
196 {
197 if (Current->Flink != NULL &&
198 ((Current->dmPelsWidth != Current->Flink->dmPelsWidth) ||
199 (Current->dmPelsHeight != Current->Flink->dmPelsHeight)))
200 {
201 ResolutionsCount++;
202 }
203 }
204
205 newEntry->Resolutions = HeapAlloc(GetProcessHeap(), 0, ResolutionsCount * sizeof(RESOLUTION_INFO));
206 if (!newEntry->Resolutions) goto ByeBye;
207
208 newEntry->ResolutionsCount = ResolutionsCount;
209
210 /* Fill resolutions infos */
211 for (Current = newEntry->Settings, i = 0; Current != NULL; Current = Current->Flink)
212 {
213 if (Current->Flink == NULL ||
214 (Current->Flink != NULL &&
215 ((Current->dmPelsWidth != Current->Flink->dmPelsWidth) ||
216 (Current->dmPelsHeight != Current->Flink->dmPelsHeight))))
217 {
218 newEntry->Resolutions[i].dmPelsWidth = Current->dmPelsWidth;
219 newEntry->Resolutions[i].dmPelsHeight = Current->dmPelsHeight;
220 i++;
221 }
222 }
223 descriptionSize = (_tcslen(DisplayDevice->DeviceString) + 1) * sizeof(TCHAR);
224 description = HeapAlloc(GetProcessHeap(), 0, descriptionSize);
225 if (!description) goto ByeBye;
226
227 nameSize = (_tcslen(DisplayDevice->DeviceName) + 1) * sizeof(TCHAR);
228 name = HeapAlloc(GetProcessHeap(), 0, nameSize);
229 if (!name) goto ByeBye;
230
231 keySize = (_tcslen(DisplayDevice->DeviceKey) + 1) * sizeof(TCHAR);
232 key = HeapAlloc(GetProcessHeap(), 0, keySize);
233 if (!key) goto ByeBye;
234
235 devidSize = (_tcslen(DisplayDevice->DeviceID) + 1) * sizeof(TCHAR);
236 devid = HeapAlloc(GetProcessHeap(), 0, devidSize);
237 if (!devid) goto ByeBye;
238
239 memcpy(description, DisplayDevice->DeviceString, descriptionSize);
240 memcpy(name, DisplayDevice->DeviceName, nameSize);
241 memcpy(key, DisplayDevice->DeviceKey, keySize);
242 memcpy(devid, DisplayDevice->DeviceID, devidSize);
243 newEntry->DeviceDescription = description;
244 newEntry->DeviceName = name;
245 newEntry->DeviceKey = key;
246 newEntry->DeviceID = devid;
247 newEntry->DeviceStateFlags = DisplayDevice->StateFlags;
248 newEntry->Flink = pData->DisplayDeviceList;
249 pData->DisplayDeviceList = newEntry;
250 return TRUE;
251
252ByeBye:
253 if (newEntry != NULL)
254 {
255 if (newEntry->Settings != NULL)
256 {
257 Current = newEntry->Settings;
258 while (Current != NULL)
259 {
260 PSETTINGS_ENTRY Next = Current->Flink;
261 HeapFree(GetProcessHeap(), 0, Current);
262 Current = Next;
263 }
264 }
265 if (newEntry->Resolutions != NULL)
266 HeapFree(GetProcessHeap(), 0, newEntry->Resolutions);
267 HeapFree(GetProcessHeap(), 0, newEntry);
268 }
269 if (description != NULL)
271 if (name != NULL)
273 if (key != NULL)
275 return FALSE;
276}
277
278static VOID
280{
281 PSETTINGS_ENTRY Current;
282 DWORD index;
283
284 pData->CurrentDisplayDevice = pDeviceEntry; /* Update variable */
285
286 /* Fill color depths combo box */
288 for (Current = pDeviceEntry->Settings; Current != NULL; Current = Current->Flink)
289 {
290 TCHAR Buffer[64];
291 if (LoadString(hApplet, (2900 + Current->dmBitsPerPel), Buffer, _countof(Buffer)))
292 {
294 if (index == (DWORD)CB_ERR)
295 {
298 }
299 }
300 }
301
302 /* Fill device description */
303 SendDlgItemMessage(hwndDlg, IDC_SETTINGS_DEVICE, WM_SETTEXT, 0, (LPARAM)pDeviceEntry->DeviceDescription);
304
305 /* Fill resolutions slider */
307 SendDlgItemMessage(hwndDlg, IDC_SETTINGS_RESOLUTION, TBM_SETRANGE, TRUE, MAKELONG(0, pDeviceEntry->ResolutionsCount - 1));
308
309 UpdateDisplay(hwndDlg, pData, TRUE);
310}
311
312static VOID
314{
316 DWORD Result = 0;
317 DWORD iDevNum = 0;
318 DWORD i;
319 DISPLAY_DEVICE displayDevice;
321
323 if (pData == NULL)
324 return;
325
327
328 /* Get video cards list */
329 pData->DisplayDeviceList = NULL;
330 displayDevice.cb = sizeof(displayDevice);
331 while (EnumDisplayDevices(NULL, iDevNum, &displayDevice, EDD_GET_DEVICE_INTERFACE_NAME))
332 {
333 if ((displayDevice.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP) != 0)
334 {
335 if (AddDisplayDevice(pData, &displayDevice))
336 Result++;
337 }
338 iDevNum++;
339 }
340
341 if (Result == 0)
342 {
343 /* No adapter found */
349
350 /* Do not initialize the color spectrum bitmaps */
351 memset(pData->hSpectrumBitmaps, 0, sizeof(pData->hSpectrumBitmaps));
352 return;
353 }
354 else if (Result == 1)
355 {
357
358 /* Single video adapter */
359 OnDisplayDeviceChanged(hwndDlg, pData, pData->DisplayDeviceList);
360
363
364 monitors.Position.x = monitors.Position.y = 0;
365 monitors.Size.cx = pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth;
366 monitors.Size.cy = pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight;
367 monitors.Flags = 0;
368 SendDlgItemMessage(hwndDlg,
371 1,
372 (LPARAM)&monitors);
373 }
374 else /* FIXME: Incomplete! */
375 {
376 PMONSL_MONINFO pMonitors;
377 DWORD i;
378
379 OnDisplayDeviceChanged(hwndDlg, pData, pData->DisplayDeviceList);
380
382
383 pMonitors = (PMONSL_MONINFO)HeapAlloc(GetProcessHeap(), 0, sizeof(MONSL_MONINFO) * Result);
384 if (pMonitors)
385 {
386 DWORD hack = 1280;
387 for (i = 0; i < Result; i++)
388 {
389 pMonitors[i].Position.x = hack * i;
390 pMonitors[i].Position.y = 0;
391 pMonitors[i].Size.cx = pData->DisplayDeviceList->CurrentSettings->dmPelsWidth;
392 pMonitors[i].Size.cy = pData->DisplayDeviceList->CurrentSettings->dmPelsHeight;
393 pMonitors[i].Flags = 0;
394 }
395
396 SendDlgItemMessage(hwndDlg,
399 Result,
400 (LPARAM)pMonitors);
401
402 HeapFree(GetProcessHeap(), 0, pMonitors);
403 }
404 }
405
406 /* Initialize the color spectrum bitmaps */
407 for (i = 0; i < NUM_SPECTRUM_BITMAPS; i++)
408 {
410
411 if (pData->hSpectrumBitmaps[i] != NULL)
412 {
413 if (GetObjectW(pData->hSpectrumBitmaps[i], sizeof(BITMAP), &bitmap) != 0)
414 {
415 pData->cxSource[i] = bitmap.bmWidth;
416 pData->cySource[i] = bitmap.bmHeight;
417 }
418 else
419 {
420 pData->cxSource[i] = 0;
421 pData->cySource[i] = 0;
422 }
423 }
424 }
425}
426
427static VOID
429{
430 HBRUSH hBrush;
431 HDC hDC;
432 HGDIOBJ hOldObj;
433 RECT rcItem = {
438 };
439
440 hDC = CreateCompatibleDC(draw->hDC);
442
443 /* FIXME: Draw resolution preview bitmap inside monitor. */
445 FillRect(hDC, &rcItem, hBrush);
446 DeleteObject(hBrush);
447
448 GdiTransparentBlt(draw->hDC,
449 draw->rcItem.left, draw->rcItem.top,
450 draw->rcItem.right - draw->rcItem.left + 1,
451 draw->rcItem.bottom - draw->rcItem.top + 1,
452 hDC,
453 0, 0,
456
457 SelectObject(hDC, hOldObj);
458 DeleteDC(hDC);
459}
460
461/* Get the ID for SETTINGS_DATA::hSpectrumBitmaps */
462static VOID
464{
465 HDC hdcMem;
466 INT iBitmap;
467
469
470 if (!hdcMem)
471 return;
472
473 switch(BitsPerPel)
474 {
475 case 4: iBitmap = 0; break;
476 case 8: iBitmap = 1; break;
477 default: iBitmap = 2;
478 }
479
480 if (SelectObject(hdcMem, pData->hSpectrumBitmaps[iBitmap]))
481 {
483 client->left, client->top,
484 client->right - client->left,
485 client->bottom - client->top,
486 hdcMem, 0, 0,
487 pData->cxSource[iBitmap],
488 pData->cySource[iBitmap], SRCCOPY);
489 }
490
492}
493
494static VOID
496{
497 /* If new BPP is not compatible with resolution:
498 * 1) try to find the nearest smaller matching resolution
499 * 2) otherwise, get the nearest bigger resolution
500 */
501 PSETTINGS_ENTRY Current;
502 DWORD dmNewBitsPerPel;
503 DWORD index;
504 HDC hSpectrumDC;
505 HWND hSpectrumControl;
506 RECT client;
507
509 dmNewBitsPerPel = (DWORD)SendDlgItemMessage(hwndDlg, IDC_SETTINGS_BPP, CB_GETITEMDATA, index, 0);
510
511 /* Show a new spectrum bitmap */
512 hSpectrumControl = GetDlgItem(hwndDlg, IDC_SETTINGS_SPECTRUM);
513 hSpectrumDC = GetDC(hSpectrumControl);
514 if (hSpectrumDC == NULL)
515 return;
516
517 GetClientRect(hSpectrumControl, &client);
518 ShowColorSpectrum(hSpectrumDC, &client, dmNewBitsPerPel, pData);
519 ReleaseDC(hSpectrumControl, hSpectrumDC);
520
521 /* Find if new parameters are valid */
522 Current = pData->CurrentDisplayDevice->CurrentSettings;
523 if (dmNewBitsPerPel == Current->dmBitsPerPel)
524 {
525 /* No change */
526 return;
527 }
528
529 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
530
531 if (dmNewBitsPerPel < Current->dmBitsPerPel)
532 {
533 Current = Current->Blink;
534 while (Current != NULL)
535 {
536 if (Current->dmBitsPerPel == dmNewBitsPerPel
537 && Current->dmPelsHeight == pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight
538 && Current->dmPelsWidth == pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth)
539 {
540 pData->CurrentDisplayDevice->CurrentSettings = Current;
541 UpdateDisplay(hwndDlg, pData, TRUE);
542 return;
543 }
544 Current = Current->Blink;
545 }
546 }
547 else
548 {
549 Current = Current->Flink;
550 while (Current != NULL)
551 {
552 if (Current->dmBitsPerPel == dmNewBitsPerPel
553 && Current->dmPelsHeight == pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight
554 && Current->dmPelsWidth == pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth)
555 {
556 pData->CurrentDisplayDevice->CurrentSettings = Current;
557 UpdateDisplay(hwndDlg, pData, TRUE);
558 return;
559 }
560 Current = Current->Flink;
561 }
562 }
563
564 /* Search smaller resolution compatible with current color depth */
565 Current = pData->CurrentDisplayDevice->CurrentSettings->Blink;
566 while (Current != NULL)
567 {
568 if (Current->dmBitsPerPel == dmNewBitsPerPel)
569 {
570 pData->CurrentDisplayDevice->CurrentSettings = Current;
571 UpdateDisplay(hwndDlg, pData, TRUE);
572 return;
573 }
574 Current = Current->Blink;
575 }
576
577 /* Search bigger resolution compatible with current color depth */
578 Current = pData->CurrentDisplayDevice->CurrentSettings->Flink;
579 while (Current != NULL)
580 {
581 if (Current->dmBitsPerPel == dmNewBitsPerPel)
582 {
583 pData->CurrentDisplayDevice->CurrentSettings = Current;
584 UpdateDisplay(hwndDlg, pData, TRUE);
585 return;
586 }
587 Current = Current->Flink;
588 }
589
590 /* We shouldn't go there */
591}
592
593static VOID
595 IN BOOL bUpdateThumb)
596{
597 /* If new resolution is not compatible with color depth:
598 * 1) try to find the nearest bigger matching color depth
599 * 2) otherwise, get the nearest smaller color depth
600 */
601 PSETTINGS_ENTRY Current;
602 DWORD dmNewPelsHeight = pData->CurrentDisplayDevice->Resolutions[NewPosition].dmPelsHeight;
603 DWORD dmNewPelsWidth = pData->CurrentDisplayDevice->Resolutions[NewPosition].dmPelsWidth;
604 DWORD dmBitsPerPel;
605 DWORD dmDisplayFrequency;
606
607 /* Find if new parameters are valid */
608 Current = pData->CurrentDisplayDevice->CurrentSettings;
609 if (dmNewPelsHeight == Current->dmPelsHeight && dmNewPelsWidth == Current->dmPelsWidth)
610 {
611 /* No change */
612 return;
613 }
614
615 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
617
618 dmBitsPerPel = Current->dmBitsPerPel;
619 dmDisplayFrequency = Current->dmDisplayFrequency;
620
621 if (CompareSettings(Current, dmNewPelsWidth,
622 dmNewPelsHeight, dmBitsPerPel,
623 dmDisplayFrequency) < 0)
624 {
625 Current = Current->Blink;
626 while (Current != NULL)
627 {
628 if (Current->dmPelsHeight == dmNewPelsHeight
629 && Current->dmPelsWidth == dmNewPelsWidth
630 && Current->dmBitsPerPel == dmBitsPerPel)
631 {
632 pData->CurrentDisplayDevice->CurrentSettings = Current;
633 UpdateDisplay(hwndDlg, pData, bUpdateThumb);
634 return;
635 }
636 Current = Current->Blink;
637 }
638 }
639 else
640 {
641 Current = Current->Flink;
642 while (Current != NULL)
643 {
644 if (Current->dmPelsHeight == dmNewPelsHeight
645 && Current->dmPelsWidth == dmNewPelsWidth
646 && Current->dmBitsPerPel == dmBitsPerPel)
647 {
648 pData->CurrentDisplayDevice->CurrentSettings = Current;
649 UpdateDisplay(hwndDlg, pData, bUpdateThumb);
650 return;
651 }
652 Current = Current->Flink;
653 }
654 }
655
656 /* Search bigger color depth compatible with current resolution */
657 Current = pData->CurrentDisplayDevice->CurrentSettings->Flink;
658 while (Current != NULL)
659 {
660 if (dmNewPelsHeight == Current->dmPelsHeight && dmNewPelsWidth == Current->dmPelsWidth)
661 {
662 pData->CurrentDisplayDevice->CurrentSettings = Current;
663 UpdateDisplay(hwndDlg, pData, bUpdateThumb);
664 return;
665 }
666 Current = Current->Flink;
667 }
668
669 /* Search smaller color depth compatible with current resolution */
670 Current = pData->CurrentDisplayDevice->CurrentSettings->Blink;
671 while (Current != NULL)
672 {
673 if (dmNewPelsHeight == Current->dmPelsHeight && dmNewPelsWidth == Current->dmPelsWidth)
674 {
675 pData->CurrentDisplayDevice->CurrentSettings = Current;
676 UpdateDisplay(hwndDlg, pData, bUpdateThumb);
677 return;
678 }
679 Current = Current->Blink;
680 }
681
682 /* We shouldn't go there */
683}
684
685/* Property sheet page callback */
688{
689 UINT Ret = 0;
690
691 switch (uMsg)
692 {
693 case PSPCB_CREATE:
695 break;
696
697 case PSPCB_RELEASE:
699 break;
700 }
701
702 return Ret;
703}
704
705static INT_PTR CALLBACK
707{
709
711
712 switch(uMsg)
713 {
714 case WM_INITDIALOG:
715 /* Allocate the local dialog data */
717 if (pData == NULL)
718 return FALSE;
719
720 /* Link the dialog data to the dialog */
722
723 /* Timeout in seconds */
724 pData->nTimeout = 15;
725
726 /* Load the raw timeout string */
727 LoadString(hApplet, IDS_TIMEOUTTEXT, pData->szRawBuffer, _countof(pData->szRawBuffer));
728
729 /* Cook the timeout string and show it */
730 _stprintf(pData->szCookedBuffer, pData->szRawBuffer, pData->nTimeout);
731 SetDlgItemText(hwndDlg, IDC_TIMEOUTTEXT, pData->szCookedBuffer);
732
733 /* Start the timer (ticks every second)*/
734 SetTimer(hwndDlg, 1, 1000, NULL);
735 break;
736
737 case WM_TIMER:
738 /* Update the timepout value */
739 pData->nTimeout--;
740
741 /* Update the timeout text */
742 _stprintf(pData->szCookedBuffer, pData->szRawBuffer, pData->nTimeout);
743 SetDlgItemText(hwndDlg, IDC_TIMEOUTTEXT, pData->szCookedBuffer);
744
745 /* Kill the timer and return a 'No', if we ran out of time */
746 if (pData->nTimeout == 0)
747 {
748 KillTimer(hwndDlg, 1);
749 EndDialog(hwndDlg, IDNO);
750 }
751 break;
752
753 case WM_COMMAND:
754 /* Kill the timer and return the clicked button id */
755 KillTimer(hwndDlg, 1);
756 EndDialog(hwndDlg, LOWORD(wParam));
757 break;
758
759 case WM_DESTROY:
760 /* Free the local dialog data */
762 break;
763 }
764
765 return FALSE;
766}
767
768BOOL
770{
771 TCHAR Message[1024], Title[256];
773
774 RtlZeroMemory(&devmode, sizeof(devmode));
775 devmode.dmSize = (WORD)sizeof(devmode);
781
782 *rc = ChangeDisplaySettingsEx(DeviceName,
783 &devmode,
784 NULL,
786 NULL);
787 switch (*rc)
788 {
790 break;
791
796 return FALSE;
797
799 default:
803 return FALSE;
804 }
805
807 {
808 return TRUE;
809 }
810 else
811 {
816
817 *rc = ChangeDisplaySettingsEx(DeviceName,
818 &devmode,
819 NULL,
821 NULL);
822 switch (*rc)
823 {
825 return FALSE;
826
831 return FALSE;
832
834 default:
838 return FALSE;
839 }
840 }
841}
842
843static
847{
848 PSETTINGS_ENTRY Request = &pDevice->InitialSettings, BestEntry = NULL, Current;
849 LONG Distance, NearestDistance = MAXLONG;
850
851 /* Find the best entry in the list */
852 for (Current = pDevice->Settings; Current; Current = Current->Flink)
853 {
854 Distance = 0x100000 * labs(Current->dmBitsPerPel - Request->dmBitsPerPel ) +
855 0x100 * labs(Current->dmPelsWidth - Request->dmPelsWidth ) +
856 0x100 * labs(Current->dmPelsHeight - Request->dmPelsHeight ) +
857 labs(Current->dmDisplayFrequency - Request->dmDisplayFrequency);
858 if (Distance == 0)
859 return Current;
860
861 if (Distance < NearestDistance)
862 {
863 BestEntry = Current;
864 NearestDistance = Distance;
865 }
866 }
867
868 return BestEntry;
869}
870
871static VOID
873{
874 BOOL Ret;
875 LONG rc;
876
877 Ret = SwitchDisplayMode(hwndDlg,
878 pData->CurrentDisplayDevice->DeviceName,
879 &pData->CurrentDisplayDevice->InitialSettings,
880 pData->CurrentDisplayDevice->CurrentSettings,
881 &rc);
882
883 if (rc != DISP_CHANGE_SUCCESSFUL)
884 return;
885
886 if (Ret)
887 {
888 pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth = pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth;
889 pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight = pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight;
890 pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel = pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel;
891 pData->CurrentDisplayDevice->InitialSettings.dmDisplayFrequency = pData->CurrentDisplayDevice->CurrentSettings->dmDisplayFrequency;
892 }
893 else
894 {
895 pData->CurrentDisplayDevice->CurrentSettings = FindBestElement(pData->CurrentDisplayDevice);
896 UpdateDisplay(hwndDlg, pData, TRUE);
897 }
898}
899
900/* Property page dialog callback */
903{
905
907
908 switch(uMsg)
909 {
910 case WM_INITDIALOG:
911 {
912 SettingsOnInitDialog(hwndDlg);
913 break;
914 }
915 case WM_DRAWITEM:
916 {
917 LPDRAWITEMSTRUCT lpDrawItem;
918 lpDrawItem = (LPDRAWITEMSTRUCT)lParam;
919
920 switch (lpDrawItem->CtlID)
921 {
923 {
924 ShowResolutionPreview(lpDrawItem, pData);
925 break;
926 }
928 {
929 ShowColorSpectrum(lpDrawItem->hDC, &lpDrawItem->rcItem, pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel, pData);
930 break;
931 }
932 }
933 break;
934 }
935 case WM_COMMAND:
936 {
937 DWORD controlId = LOWORD(wParam);
939
940 if (controlId == IDC_SETTINGS_ADVANCED && command == BN_CLICKED)
941 {
942 if (DisplayAdvancedSettings(hwndDlg, pData->CurrentDisplayDevice))
943 {
945 ZeroMemory(&devmode, sizeof(devmode));
946 devmode.dmSize = (WORD)sizeof(devmode);
947 if (EnumDisplaySettingsExW(pData->CurrentDisplayDevice->DeviceName,
949 {
950 PSETTINGS_ENTRY pInitialSettings = &pData->CurrentDisplayDevice->InitialSettings;
951 pInitialSettings->dmPelsWidth = devmode.dmPelsWidth;
952 pInitialSettings->dmPelsHeight = devmode.dmPelsHeight;
953 pInitialSettings->dmBitsPerPel = devmode.dmBitsPerPel;
955 pData->CurrentDisplayDevice->CurrentSettings =
956 FindBestElement(pData->CurrentDisplayDevice);
957 UpdateDisplay(hwndDlg, pData, TRUE);
958 }
959 }
960 }
961 else if (controlId == IDC_SETTINGS_BPP && command == CBN_SELCHANGE)
962 OnBPPChanged(hwndDlg, pData);
963 break;
964 }
965 case WM_HSCROLL:
966 {
967 switch (LOWORD(wParam))
968 {
969 case TB_LINEUP:
970 case TB_LINEDOWN:
971 case TB_PAGEUP:
972 case TB_PAGEDOWN:
973 case TB_TOP:
974 case TB_BOTTOM:
975 case TB_ENDTRACK:
976 {
977 DWORD newPosition = (DWORD)SendDlgItemMessage(hwndDlg, IDC_SETTINGS_RESOLUTION, TBM_GETPOS, 0, 0);
978 OnResolutionChanged(hwndDlg, pData, newPosition, TRUE);
979 break;
980 }
981
982 case TB_THUMBTRACK:
984 break;
985 }
986 break;
987 }
988 case WM_NOTIFY:
989 {
990 LPNMHDR lpnm = (LPNMHDR)lParam;
991 if (lpnm->code == (UINT)PSN_APPLY)
992 {
993 if (pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth != pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth
994 || pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight != pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight
995 || pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel != pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel)
996 {
997 /* Apply new settings */
998 ApplyDisplaySettings(hwndDlg, pData);
999 }
1000 }
1001 else if (lpnm->code == MSLN_MONITORCHANGED)
1002 {
1004 PDISPLAY_DEVICE_ENTRY Current = pData->DisplayDeviceList;
1005 ULONG i;
1006 for (i = 0; i < lpnmi->hdr.Index; i++)
1007 Current = Current->Flink;
1008 OnDisplayDeviceChanged(hwndDlg, pData, Current);
1009 }
1010 break;
1011 }
1012
1013 case WM_CONTEXTMENU:
1014 {
1015 HWND hwndMonSel;
1016 HMENU hPopup;
1017 UINT uiCmd;
1018 POINT pt, ptClient;
1019 INT Index;
1020
1021 pt.x = (SHORT)LOWORD(lParam);
1022 pt.y = (SHORT)HIWORD(lParam);
1023
1024 hwndMonSel = GetDlgItem(hwndDlg, IDC_SETTINGS_MONSEL);
1025 if ((HWND)wParam == hwndMonSel)
1026 {
1027 if (pt.x == -1 && pt.y == -1)
1028 {
1029 RECT rcMon;
1030
1031 Index = (INT)SendMessage(hwndMonSel,
1033 0,
1034 0);
1035
1036 if (Index >= 0 &&
1037 (INT)SendMessage(hwndMonSel,
1039 Index,
1040 (LPARAM)&rcMon) > 0)
1041 {
1042 pt.x = rcMon.left + ((rcMon.right - rcMon.left) / 2);
1043 pt.y = rcMon.top + ((rcMon.bottom - rcMon.top) / 2);
1044 }
1045 else
1046 pt.x = pt.y = 0;
1047
1048 MapWindowPoints(hwndMonSel, NULL, &pt, 1);
1049 }
1050 else
1051 {
1052 ptClient = pt;
1053 MapWindowPoints(NULL, hwndMonSel, &ptClient, 1);
1054
1055 Index = (INT)SendMessage(hwndMonSel,
1057 (WPARAM)&ptClient,
1058 0);
1059 }
1060
1061 if (Index >= 0)
1062 {
1063 hPopup = LoadPopupMenu(hApplet,
1065 if (hPopup != NULL)
1066 {
1067 /* FIXME: Enable/Disable menu items */
1068 EnableMenuItem(hPopup,
1071 EnableMenuItem(hPopup,
1074 EnableMenuItem(hPopup,
1077 EnableMenuItem(hPopup,
1080
1081 uiCmd = (UINT)TrackPopupMenu(hPopup,
1083 pt.x,
1084 pt.y,
1085 0,
1086 hwndDlg,
1087 NULL);
1088
1089 switch (uiCmd)
1090 {
1091 case ID_MENU_ATTACHED:
1092 case ID_MENU_PRIMARY:
1093 case ID_MENU_IDENTIFY:
1094 case ID_MENU_PROPERTIES:
1095 /* FIXME: Implement */
1096 break;
1097 }
1098
1099 DestroyMenu(hPopup);
1100 }
1101 }
1102 }
1103 break;
1104 }
1105
1106 case WM_DESTROY:
1107 {
1108 DWORD i;
1109 PDISPLAY_DEVICE_ENTRY Current = pData->DisplayDeviceList;
1110
1111 while (Current != NULL)
1112 {
1113 PDISPLAY_DEVICE_ENTRY Next = Current->Flink;
1114 PSETTINGS_ENTRY CurrentSettings = Current->Settings;
1115 while (CurrentSettings != NULL)
1116 {
1117 PSETTINGS_ENTRY NextSettings = CurrentSettings->Flink;
1118 HeapFree(GetProcessHeap(), 0, CurrentSettings);
1119 CurrentSettings = NextSettings;
1120 }
1121 HeapFree(GetProcessHeap(), 0, Current);
1122 Current = Next;
1123 }
1124
1125 for (i = 0; i < NUM_SPECTRUM_BITMAPS; i++)
1126 {
1127 if (pData->hSpectrumBitmaps[i])
1128 DeleteObject(pData->hSpectrumBitmaps[i]);
1129 }
1130
1132 }
1133 }
1134 return FALSE;
1135}
static HDC hDC
Definition: 3dtext.c:33
DEVMODEW devmode
BOOL DisplayAdvancedSettings(HWND hWndParent, PDISPLAY_DEVICE_ENTRY DisplayDevice)
Definition: advmon.c:77
GLOBAL_DATA g_GlobalData
Definition: background.c:70
#define IDS_PIXEL
Definition: resource.h:41
#define IDC_SETTINGS_RESOLUTION_TEXT
Definition: resource.h:21
#define index(s, c)
Definition: various.h:29
HMENU LoadPopupMenu(IN HINSTANCE hInstance, IN LPCWSTR lpMenuName)
Definition: util.cpp:33
Definition: bufpool.h:45
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define MONITOR_BOTTOM
Definition: desk.h:74
#define MONITOR_LEFT
Definition: desk.h:71
#define MONITOR_ALPHA
Definition: desk.h:79
#define NUM_SPECTRUM_BITMAPS
Definition: desk.h:82
#define MONITOR_TOP
Definition: desk.h:72
#define MONITOR_RIGHT
Definition: desk.h:73
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HINSTANCE hApplet
Definition: access.c:17
#define IDC_SETTINGS_RESOLUTION
Definition: resource.h:66
#define ID_MENU_PROPERTIES
Definition: resource.h:86
#define IDC_SETTINGS_BPP
Definition: resource.h:65
#define IDB_SPECTRUM_4
Definition: resource.h:73
#define IDC_RESOLUTION_PREVIEW
Definition: resource.h:35
#define IDC_SETTINGS_MONSEL
Definition: resource.h:69
#define ID_MENU_IDENTIFY
Definition: resource.h:85
#define IDC_SETTINGS_SPECTRUM
Definition: resource.h:70
#define IDM_MONITOR_MENU
Definition: resource.h:82
#define IDS_DISPLAY_SETTINGS
Definition: resource.h:161
#define IDC_TIMEOUTTEXT
Definition: resource.h:201
#define IDC_SETTINGS_MONTEXT
Definition: resource.h:71
#define IDS_TIMEOUTTEXT
Definition: resource.h:202
#define IDS_APPLY_NEEDS_RESTART
Definition: resource.h:164
#define IDC_SETTINGS_DEVICE
Definition: resource.h:64
#define IDD_CONFIRMSETTINGS
Definition: resource.h:19
#define IDC_SETTINGS_ADVANCED
Definition: resource.h:68
#define ID_MENU_PRIMARY
Definition: resource.h:84
#define ID_MENU_ATTACHED
Definition: resource.h:83
#define IDS_APPLY_FAILED
Definition: resource.h:163
static BOOL AddDisplayDevice(IN PSETTINGS_DATA pData, IN const DISPLAY_DEVICE *DisplayDevice)
Definition: settings.c:171
static VOID ShowColorSpectrum(IN HDC hDC, IN LPRECT client, IN DWORD BitsPerPel, IN PSETTINGS_DATA pData)
Definition: settings.c:463
static VOID UpdateDisplay(IN HWND hwndDlg, PSETTINGS_DATA pData, IN BOOL bUpdateThumb)
Definition: settings.c:28
static VOID OnResolutionChanged(IN HWND hwndDlg, IN PSETTINGS_DATA pData, IN DWORD NewPosition, IN BOOL bUpdateThumb)
Definition: settings.c:594
static INT_PTR CALLBACK ConfirmDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: settings.c:706
static VOID SettingsOnInitDialog(IN HWND hwndDlg)
Definition: settings.c:313
struct _SETTINGS_DATA * PSETTINGS_DATA
static PSETTINGS_ENTRY GetPossibleSettings(IN LPCTSTR DeviceName, OUT DWORD *pSettingsCount, OUT PSETTINGS_ENTRY *CurrentSettings)
Definition: settings.c:86
struct _TIMEOUTDATA * PTIMEOUTDATA
static PSETTINGS_ENTRY FindBestElement(_In_ PDISPLAY_DEVICE_ENTRY pDevice)
Definition: settings.c:845
static VOID OnDisplayDeviceChanged(IN HWND hwndDlg, IN PSETTINGS_DATA pData, IN PDISPLAY_DEVICE_ENTRY pDeviceEntry)
Definition: settings.c:279
static int CompareSettings(PSETTINGS_ENTRY Entry, DWORD dmPelsWidth, DWORD dmPelsHeight, DWORD dmBitsPerPel, DWORD dmDisplayFrequency)
Definition: settings.c:64
static VOID ApplyDisplaySettings(HWND hwndDlg, PSETTINGS_DATA pData)
Definition: settings.c:872
INT_PTR CALLBACK SettingsPageProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: settings.c:902
static VOID OnBPPChanged(IN HWND hwndDlg, IN PSETTINGS_DATA pData)
Definition: settings.c:495
UINT CALLBACK SettingsPageCallbackProc(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
Definition: settings.c:687
struct _SETTINGS_DATA SETTINGS_DATA
static VOID ShowResolutionPreview(IN LPDRAWITEMSTRUCT draw, IN PSETTINGS_DATA pData)
Definition: settings.c:428
struct _TIMEOUTDATA TIMEOUTDATA
BOOL SwitchDisplayMode(HWND hwndDlg, PWSTR DeviceName, PSETTINGS_ENTRY seInit, PSETTINGS_ENTRY seNew, OUT PLONG rc)
Definition: settings.c:769
DWORD bpp
Definition: surface.c:185
static const WCHAR Title[]
Definition: oid.c:1259
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static const WCHAR Message[]
Definition: register.c:74
#define pt(x, y)
Definition: drawing.c:79
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
FxDevice * pDevice
pKey DeleteObject()
GLuint * monitors
Definition: glext.h:11118
GLuint index
Definition: glext.h:6031
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
_Check_return_ long __cdecl labs(_In_ long x)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define _stprintf
Definition: utility.h:124
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
VOID UnregisterMonitorSelectionControl(IN HINSTANCE hInstance)
Definition: monslctl.c:1655
BOOL RegisterMonitorSelectionControl(IN HINSTANCE hInstance)
Definition: monslctl.c:1638
struct _MONSL_MONINFO MONSL_MONINFO
#define MSLM_GETCURSEL
Definition: monslctl.h:139
struct _MONSL_MONNMMONITORCHANGING * PMONSL_MONNMMONITORCHANGING
struct _MONSL_MONINFO * PMONSL_MONINFO
#define MSLM_SETMONITORSINFO
Definition: monslctl.h:89
#define MSLM_GETMONITORINFO
Definition: monslctl.h:161
#define MSLM_SETMONITORINFO
Definition: monslctl.h:150
#define MSLN_MONITORCHANGED
Definition: monslctl.h:66
#define MSLM_GETMONITORRECT
Definition: monslctl.h:212
#define MSLM_HITTEST
Definition: monslctl.h:120
#define _In_
Definition: ms_sal.h:308
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define DWORD
Definition: nt_native.h:44
#define LOWORD(l)
Definition: pedump.c:82
short SHORT
Definition: pedump.c:59
long LONG
Definition: pedump.c:60
#define INT
Definition: polytest.cpp:20
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSPCB_CREATE
Definition: prsht.h:38
#define PSN_APPLY
Definition: prsht.h:117
#define PSPCB_RELEASE
Definition: prsht.h:37
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define TB_TOP
Definition: commctrl.h:2084
#define TB_ENDTRACK
Definition: commctrl.h:2086
#define TB_PAGEUP
Definition: commctrl.h:2080
#define TB_BOTTOM
Definition: commctrl.h:2085
#define TBM_GETPOS
Definition: commctrl.h:2036
#define TBM_CLEARTICS
Definition: commctrl.h:2045
#define TB_PAGEDOWN
Definition: commctrl.h:2081
#define TBM_SETRANGE
Definition: commctrl.h:2042
#define TB_THUMBTRACK
Definition: commctrl.h:2083
#define TB_LINEUP
Definition: commctrl.h:2078
#define TBM_SETPOS
Definition: commctrl.h:2041
#define TB_LINEDOWN
Definition: commctrl.h:2079
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_NOTIFY
Definition: richedit.h:61
#define memset(x, y, z)
Definition: compat.h:39
static FILE * client
Definition: client.c:41
#define _countof(array)
Definition: sndvol32.h:70
base of all file and directory entries
Definition: entries.h:83
Definition: bl.h:1331
DWORD StateFlags
Definition: wingdi.h:2812
Definition: precomp.h:68
PRESOLUTION_INFO Resolutions
Definition: precomp.h:77
struct _DISPLAY_DEVICE_ENTRY * Flink
Definition: precomp.h:69
DWORD SettingsCount
Definition: precomp.h:76
SETTINGS_ENTRY InitialSettings
Definition: precomp.h:80
PSETTINGS_ENTRY CurrentSettings
Definition: precomp.h:79
DWORD ResolutionsCount
Definition: precomp.h:78
DWORD DeviceStateFlags
Definition: precomp.h:74
LPWSTR DeviceID
Definition: precomp.h:73
LPWSTR DeviceDescription
Definition: precomp.h:70
PSETTINGS_ENTRY Settings
Definition: precomp.h:75
LPWSTR DeviceKey
Definition: precomp.h:72
LPWSTR DeviceName
Definition: precomp.h:71
LONG bmMonHeight
Definition: desk.h:164
LONG bmMonWidth
Definition: desk.h:163
COLORREF desktop_color
Definition: desk.h:159
HBITMAP hMonitorBitmap
Definition: desk.h:162
DWORD Flags
Definition: monslctl.h:19
POINT Position
Definition: monslctl.h:17
MONSL_MONNMHDR hdr
Definition: monslctl.h:41
DWORD dmPelsWidth
Definition: precomp.h:54
DWORD dmPelsHeight
Definition: precomp.h:55
int cxSource[NUM_SPECTRUM_BITMAPS]
Definition: settings.c:16
PDISPLAY_DEVICE_ENTRY CurrentDisplayDevice
Definition: settings.c:14
HBITMAP hSpectrumBitmaps[NUM_SPECTRUM_BITMAPS]
Definition: settings.c:15
int cySource[NUM_SPECTRUM_BITMAPS]
Definition: settings.c:17
PDISPLAY_DEVICE_ENTRY DisplayDeviceList
Definition: settings.c:13
Definition: precomp.h:59
DWORD dmPelsHeight
Definition: precomp.h:64
DWORD dmDisplayFrequency
Definition: desk.h:138
struct _SETTINGS_ENTRY * Flink
Definition: precomp.h:61
struct _SETTINGS_ENTRY * Blink
Definition: precomp.h:60
DWORD dmBitsPerPel
Definition: precomp.h:62
DWORD dmPelsWidth
Definition: precomp.h:63
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
INT nTimeout
Definition: settings.c:24
TCHAR szCookedBuffer[256]
Definition: settings.c:23
TCHAR szRawBuffer[256]
Definition: settings.c:22
DWORD dmBitsPerPel
Definition: wingdi.h:1647
DWORD dmFields
Definition: wingdi.h:1622
DWORD dmPelsWidth
Definition: wingdi.h:1648
WORD dmDriverExtra
Definition: wingdi.h:1621
DWORD dmPelsHeight
Definition: wingdi.h:1649
DWORD dmDisplayFrequency
Definition: wingdi.h:1654
WORD dmSize
Definition: wingdi.h:1620
Definition: uimain.c:89
Definition: copy.c:22
Definition: name.c:39
UINT code
Definition: winuser.h:3162
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
uint16_t * PWSTR
Definition: typedefs.h:56
int32_t INT_PTR
Definition: typedefs.h:64
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
int32_t * PLONG
Definition: typedefs.h:58
#define MAKELONG(a, b)
Definition: typedefs.h:249
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
#define OUT
Definition: typedefs.h:40
#define MAXLONG
Definition: umtypes.h:116
BOOL WINAPI GdiTransparentBlt(HDC hdcDst, int xDst, int yDst, int wDst, int hDst, HDC hdcSrc, int xSrc, int ySrc, int wSrc, int hSrc, UINT crTransparent)
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
Definition: wdfdevice.h:2595
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
HDC hdcMem
Definition: welcome.c:104
BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode, DWORD dwFlags)
Definition: display.c:330
#define ZeroMemory
Definition: winbase.h:1736
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ ULONG iMode
Definition: winddi.h:3520
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
const char * description
Definition: directx.c:2497
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1272
#define HORZRES
Definition: wingdi.h:716
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define DM_PELSWIDTH
Definition: wingdi.h:1269
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
#define SRCCOPY
Definition: wingdi.h:333
#define VERTRES
Definition: wingdi.h:717
#define DM_BITSPERPEL
Definition: wingdi.h:1268
#define PLANES
Definition: wingdi.h:721
#define CreateIC
Definition: wingdi.h:4446
#define BITSPIXEL
Definition: wingdi.h:720
#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
Definition: wingdi.h:1396
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
#define DM_PELSHEIGHT
Definition: wingdi.h:1270
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CB_SELECTSTRING
Definition: winuser.h:1963
#define CB_SETITEMDATA
Definition: winuser.h:1969
#define SW_HIDE
Definition: winuser.h:771
#define MF_BYCOMMAND
Definition: winuser.h:202
#define IMAGE_BITMAP
Definition: winuser.h:211
#define DWLP_USER
Definition: winuser.h:875
#define WM_HSCROLL
Definition: winuser.h:1746
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define TPM_RIGHTBUTTON
Definition: winuser.h:2383
#define WM_COMMAND
Definition: winuser.h:1743
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190
#define CB_ERR
Definition: winuser.h:2438
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2255
#define CB_RESETCONTENT
Definition: winuser.h:1962
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1943
#define WM_INITDIALOG
Definition: winuser.h:1742
#define CDS_UPDATEREGISTRY
Definition: winuser.h:181
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_DRAWITEM
Definition: winuser.h:1648
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define CBN_SELCHANGE
Definition: winuser.h:1982
#define DISP_CHANGE_FAILED
Definition: winuser.h:194
#define WM_SETTEXT
Definition: winuser.h:1620
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179
#define WM_TIMER
Definition: winuser.h:1745
#define IDNO
Definition: winuser.h:839
#define CB_ADDSTRING
Definition: winuser.h:1939
struct tagNMHDR * LPNMHDR
#define CB_GETITEMDATA
Definition: winuser.h:1953
#define SendMessage
Definition: winuser.h:5855
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HDC WINAPI GetDC(_In_opt_ HWND)
#define MB_OK
Definition: winuser.h:793
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define LoadString
Definition: winuser.h:5831
#define MessageBox
Definition: winuser.h:5834
#define MB_ICONINFORMATION
Definition: winuser.h:805
#define MB_ICONSTOP
Definition: winuser.h:806
#define LR_DEFAULTCOLOR
Definition: winuser.h:1090
#define BN_CLICKED
Definition: winuser.h:1928
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define WM_DESTROY
Definition: winuser.h:1612
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:838
#define TPM_RETURNCMD
Definition: winuser.h:2390
#define DISP_CHANGE_RESTART
Definition: winuser.h:191
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define CB_GETCURSEL
Definition: winuser.h:1946
#define SendDlgItemMessage
Definition: winuser.h:5854
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define SetDlgItemText
Definition: winuser.h:5861
#define DialogBox
Definition: winuser.h:5773
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define MF_GRAYED
Definition: winuser.h:129
#define MF_DISABLED
Definition: winuser.h:130
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
char TCHAR
Definition: xmlstorage.h:189
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define _tcslen
Definition: xmlstorage.h:198