37 _stprintf(
Buffer, Pixel,
pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth,
pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight, Pixel);
42 if (
pData->CurrentDisplayDevice->Resolutions[
index].dmPelsWidth ==
pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth &&
43 pData->CurrentDisplayDevice->Resolutions[
index].dmPelsHeight ==
pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight)
57 info.Size.cx =
pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth;
58 info.Size.cy =
pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight;
67 if (
Entry->dmPelsWidth == dmPelsWidth &&
68 Entry->dmPelsHeight == dmPelsHeight &&
69 Entry->dmBitsPerPel == dmBitsPerPel &&
70 Entry->dmDisplayFrequency == dmDisplayFrequency)
75 if ((
Entry->dmPelsWidth < dmPelsWidth) ||
76 (
Entry->dmPelsWidth == dmPelsWidth &&
Entry->dmPelsHeight < dmPelsHeight) ||
77 (
Entry->dmPelsWidth == dmPelsWidth &&
Entry->dmPelsHeight == dmPelsHeight &&
78 Entry->dmBitsPerPel < dmBitsPerPel))
99 *CurrentSettings =
NULL;
142 while (Next !=
NULL &&
150 Current->
Blink = Previous;
151 Current->
Flink = Next;
152 if (Previous ==
NULL)
155 Previous->
Flink = Current;
157 Next->
Blink = Current;
160 *CurrentSettings = Current;
166 *pSettingsCount = NbSettings;
178 SIZE_T descriptionSize, nameSize, keySize, devidSize;
180 DWORD ResolutionsCount = 1;
184 if (!newEntry)
goto ByeBye;
187 if (!newEntry->
Settings)
goto ByeBye;
223 descriptionSize = (
_tcslen(DisplayDevice->DeviceString) + 1) *
sizeof(
TCHAR);
227 nameSize = (
_tcslen(DisplayDevice->DeviceName) + 1) *
sizeof(
TCHAR);
229 if (!
name)
goto ByeBye;
231 keySize = (
_tcslen(DisplayDevice->DeviceKey) + 1) *
sizeof(
TCHAR);
233 if (!
key)
goto ByeBye;
235 devidSize = (
_tcslen(DisplayDevice->DeviceID) + 1) *
sizeof(
TCHAR);
237 if (!devid)
goto ByeBye;
240 memcpy(
name, DisplayDevice->DeviceName, nameSize);
241 memcpy(
key, DisplayDevice->DeviceKey, keySize);
242 memcpy(devid, DisplayDevice->DeviceID, devidSize);
249 pData->DisplayDeviceList = newEntry;
253 if (newEntry !=
NULL)
258 while (Current !=
NULL)
284 pData->CurrentDisplayDevice = pDeviceEntry;
288 for (Current = pDeviceEntry->Settings; Current !=
NULL; Current = Current->
Flink)
330 displayDevice.
cb =
sizeof(displayDevice);
331 while (EnumDisplayDevices(
NULL, iDevNum, &displayDevice, EDD_GET_DEVICE_INTERFACE_NAME))
365 monitors.Size.cx =
pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth;
366 monitors.Size.cy =
pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight;
391 pMonitors[
i].
Size.
cx =
pData->DisplayDeviceList->CurrentSettings->dmPelsWidth;
392 pMonitors[
i].
Size.
cy =
pData->DisplayDeviceList->CurrentSettings->dmPelsHeight;
449 draw->rcItem.left, draw->rcItem.top,
450 draw->rcItem.right - draw->rcItem.left + 1,
451 draw->rcItem.bottom - draw->rcItem.top + 1,
475 case 4: iBitmap = 0;
break;
476 case 8: iBitmap = 1;
break;
477 default: iBitmap = 2;
487 pData->cxSource[iBitmap],
502 DWORD dmNewBitsPerPel;
505 HWND hSpectrumControl;
513 hSpectrumDC =
GetDC(hSpectrumControl);
514 if (hSpectrumDC ==
NULL)
519 ReleaseDC(hSpectrumControl, hSpectrumDC);
522 Current =
pData->CurrentDisplayDevice->CurrentSettings;
531 if (dmNewBitsPerPel < Current->dmBitsPerPel)
533 Current = Current->
Blink;
534 while (Current !=
NULL)
537 && Current->
dmPelsHeight ==
pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight
538 && Current->
dmPelsWidth ==
pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth)
540 pData->CurrentDisplayDevice->CurrentSettings = Current;
544 Current = Current->
Blink;
549 Current = Current->
Flink;
550 while (Current !=
NULL)
553 && Current->
dmPelsHeight ==
pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight
554 && Current->
dmPelsWidth ==
pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth)
556 pData->CurrentDisplayDevice->CurrentSettings = Current;
560 Current = Current->
Flink;
565 Current =
pData->CurrentDisplayDevice->CurrentSettings->
Blink;
566 while (Current !=
NULL)
570 pData->CurrentDisplayDevice->CurrentSettings = Current;
574 Current = Current->
Blink;
578 Current =
pData->CurrentDisplayDevice->CurrentSettings->
Flink;
579 while (Current !=
NULL)
583 pData->CurrentDisplayDevice->CurrentSettings = Current;
587 Current = Current->
Flink;
603 DWORD dmNewPelsWidth =
pData->CurrentDisplayDevice->Resolutions[NewPosition].dmPelsWidth;
605 DWORD dmDisplayFrequency;
608 Current =
pData->CurrentDisplayDevice->CurrentSettings;
622 dmNewPelsHeight, dmBitsPerPel,
623 dmDisplayFrequency) < 0)
625 Current = Current->
Blink;
626 while (Current !=
NULL)
632 pData->CurrentDisplayDevice->CurrentSettings = Current;
636 Current = Current->
Blink;
641 Current = Current->
Flink;
642 while (Current !=
NULL)
648 pData->CurrentDisplayDevice->CurrentSettings = Current;
652 Current = Current->
Flink;
657 Current =
pData->CurrentDisplayDevice->CurrentSettings->
Flink;
658 while (Current !=
NULL)
662 pData->CurrentDisplayDevice->CurrentSettings = Current;
666 Current = Current->
Flink;
670 Current =
pData->CurrentDisplayDevice->CurrentSettings->
Blink;
671 while (Current !=
NULL)
675 pData->CurrentDisplayDevice->CurrentSettings = Current;
679 Current = Current->
Blink;
724 pData->nTimeout = 15;
746 if (
pData->nTimeout == 0)
852 for (Current =
pDevice->Settings; Current; Current = Current->Flink)
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);
861 if (Distance < NearestDistance)
864 NearestDistance = Distance;
878 pData->CurrentDisplayDevice->DeviceName,
879 &
pData->CurrentDisplayDevice->InitialSettings,
880 pData->CurrentDisplayDevice->CurrentSettings,
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;
920 switch (lpDrawItem->
CtlID)
955 pData->CurrentDisplayDevice->CurrentSettings =
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)
1007 Current = Current->
Flink;
1027 if (
pt.x == -1 &&
pt.y == -1)
1111 while (Current !=
NULL)
1115 while (CurrentSettings !=
NULL)
1119 CurrentSettings = NextSettings;
1127 if (
pData->hSpectrumBitmaps[
i])
BOOL DisplayAdvancedSettings(HWND hWndParent, PDISPLAY_DEVICE_ENTRY DisplayDevice)
#define IDC_SETTINGS_RESOLUTION_TEXT
HMENU LoadPopupMenu(IN HINSTANCE hInstance, IN LPCWSTR lpMenuName)
#define NUM_SPECTRUM_BITMAPS
#define IDC_SETTINGS_RESOLUTION
#define ID_MENU_PROPERTIES
#define IDC_RESOLUTION_PREVIEW
#define IDC_SETTINGS_MONSEL
#define IDC_SETTINGS_SPECTRUM
#define IDS_DISPLAY_SETTINGS
#define IDC_SETTINGS_MONTEXT
#define IDS_APPLY_NEEDS_RESTART
#define IDC_SETTINGS_DEVICE
#define IDD_CONFIRMSETTINGS
#define IDC_SETTINGS_ADVANCED
static BOOL AddDisplayDevice(IN PSETTINGS_DATA pData, IN const DISPLAY_DEVICE *DisplayDevice)
static VOID ShowColorSpectrum(IN HDC hDC, IN LPRECT client, IN DWORD BitsPerPel, IN PSETTINGS_DATA pData)
static VOID UpdateDisplay(IN HWND hwndDlg, PSETTINGS_DATA pData, IN BOOL bUpdateThumb)
static VOID OnResolutionChanged(IN HWND hwndDlg, IN PSETTINGS_DATA pData, IN DWORD NewPosition, IN BOOL bUpdateThumb)
static INT_PTR CALLBACK ConfirmDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
static VOID SettingsOnInitDialog(IN HWND hwndDlg)
struct _SETTINGS_DATA * PSETTINGS_DATA
static PSETTINGS_ENTRY GetPossibleSettings(IN LPCTSTR DeviceName, OUT DWORD *pSettingsCount, OUT PSETTINGS_ENTRY *CurrentSettings)
struct _TIMEOUTDATA * PTIMEOUTDATA
static PSETTINGS_ENTRY FindBestElement(_In_ PDISPLAY_DEVICE_ENTRY pDevice)
static VOID OnDisplayDeviceChanged(IN HWND hwndDlg, IN PSETTINGS_DATA pData, IN PDISPLAY_DEVICE_ENTRY pDeviceEntry)
static int CompareSettings(PSETTINGS_ENTRY Entry, DWORD dmPelsWidth, DWORD dmPelsHeight, DWORD dmBitsPerPel, DWORD dmDisplayFrequency)
static VOID ApplyDisplaySettings(HWND hwndDlg, PSETTINGS_DATA pData)
INT_PTR CALLBACK SettingsPageProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
static VOID OnBPPChanged(IN HWND hwndDlg, IN PSETTINGS_DATA pData)
UINT CALLBACK SettingsPageCallbackProc(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
struct _SETTINGS_DATA SETTINGS_DATA
static VOID ShowResolutionPreview(IN LPDRAWITEMSTRUCT draw, IN PSETTINGS_DATA pData)
struct _TIMEOUTDATA TIMEOUTDATA
BOOL SwitchDisplayMode(HWND hwndDlg, PWSTR DeviceName, PSETTINGS_ENTRY seInit, PSETTINGS_ENTRY seNew, OUT PLONG rc)
static const WCHAR Title[]
#define HeapFree(x, y, z)
static const WCHAR Message[]
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
_Check_return_ long __cdecl labs(_In_ long x)
#define memcpy(s1, s2, n)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
VOID UnregisterMonitorSelectionControl(IN HINSTANCE hInstance)
BOOL RegisterMonitorSelectionControl(IN HINSTANCE hInstance)
struct _MONSL_MONINFO MONSL_MONINFO
struct _MONSL_MONNMMONITORCHANGING * PMONSL_MONNMMONITORCHANGING
struct _MONSL_MONINFO * PMONSL_MONINFO
#define MSLM_SETMONITORSINFO
#define MSLM_GETMONITORINFO
#define MSLM_SETMONITORINFO
#define MSLN_MONITORCHANGED
#define MSLM_GETMONITORRECT
#define PropSheet_Changed(d, w)
base of all file and directory entries
PRESOLUTION_INFO Resolutions
struct _DISPLAY_DEVICE_ENTRY * Flink
SETTINGS_ENTRY InitialSettings
PSETTINGS_ENTRY CurrentSettings
int cxSource[NUM_SPECTRUM_BITMAPS]
PDISPLAY_DEVICE_ENTRY CurrentDisplayDevice
HBITMAP hSpectrumBitmaps[NUM_SPECTRUM_BITMAPS]
int cySource[NUM_SPECTRUM_BITMAPS]
PDISPLAY_DEVICE_ENTRY DisplayDeviceList
struct _SETTINGS_ENTRY * Flink
struct _SETTINGS_ENTRY * Blink
TCHAR szCookedBuffer[256]
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
#define RtlZeroMemory(Destination, Length)
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
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode, DWORD dwFlags)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define DM_DISPLAYFREQUENCY
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
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 DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define DISP_CHANGE_SUCCESSFUL
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
#define CB_FINDSTRINGEXACT
#define CDS_UPDATEREGISTRY
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)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define DISP_CHANGE_FAILED
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define ENUM_CURRENT_SETTINGS
struct tagNMHDR * LPNMHDR
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HDC WINAPI GetDC(_In_opt_ HWND)
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define MB_ICONINFORMATION
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
#define DISP_CHANGE_RESTART
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SendDlgItemMessage
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
_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