39 _stprintf(
Buffer, Pixel,
pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth,
pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight, Pixel);
44 if (
pData->CurrentDisplayDevice->Resolutions[
index].dmPelsWidth ==
pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth &&
45 pData->CurrentDisplayDevice->Resolutions[
index].dmPelsHeight ==
pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight)
59 info.Size.cx =
pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth;
60 info.Size.cy =
pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight;
69 if (
Entry->dmPelsWidth == dmPelsWidth &&
70 Entry->dmPelsHeight == dmPelsHeight &&
71 Entry->dmBitsPerPel == dmBitsPerPel &&
72 Entry->dmDisplayFrequency == dmDisplayFrequency)
77 if ((
Entry->dmPelsWidth < dmPelsWidth) ||
78 (
Entry->dmPelsWidth == dmPelsWidth &&
Entry->dmPelsHeight < dmPelsHeight) ||
79 (
Entry->dmPelsWidth == dmPelsWidth &&
Entry->dmPelsHeight == dmPelsHeight &&
80 Entry->dmBitsPerPel < dmBitsPerPel))
101 *CurrentSettings =
NULL;
144 while (Next !=
NULL &&
152 Current->
Blink = Previous;
153 Current->
Flink = Next;
154 if (Previous ==
NULL)
157 Previous->
Flink = Current;
159 Next->
Blink = Current;
162 *CurrentSettings = Current;
168 *pSettingsCount = NbSettings;
180 SIZE_T descriptionSize, nameSize, keySize, devidSize;
182 DWORD ResolutionsCount = 1;
186 if (!newEntry)
goto ByeBye;
189 if (!newEntry->
Settings)
goto ByeBye;
225 descriptionSize = (
_tcslen(DisplayDevice->DeviceString) + 1) *
sizeof(
TCHAR);
229 nameSize = (
_tcslen(DisplayDevice->DeviceName) + 1) *
sizeof(
TCHAR);
231 if (!
name)
goto ByeBye;
233 keySize = (
_tcslen(DisplayDevice->DeviceKey) + 1) *
sizeof(
TCHAR);
235 if (!
key)
goto ByeBye;
237 devidSize = (
_tcslen(DisplayDevice->DeviceID) + 1) *
sizeof(
TCHAR);
239 if (!devid)
goto ByeBye;
242 memcpy(
name, DisplayDevice->DeviceName, nameSize);
243 memcpy(
key, DisplayDevice->DeviceKey, keySize);
244 memcpy(devid, DisplayDevice->DeviceID, devidSize);
251 pData->DisplayDeviceList = newEntry;
255 if (newEntry !=
NULL)
260 while (Current !=
NULL)
286 pData->CurrentDisplayDevice = pDeviceEntry;
290 for (Current = pDeviceEntry->Settings; Current !=
NULL; Current = Current->
Flink)
332 displayDevice.
cb =
sizeof(displayDevice);
333 while (EnumDisplayDevices(
NULL, iDevNum, &displayDevice, EDD_GET_DEVICE_INTERFACE_NAME))
367 monitors.Size.cx =
pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth;
368 monitors.Size.cy =
pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight;
393 pMonitors[
i].
Size.
cx =
pData->DisplayDeviceList->CurrentSettings->dmPelsWidth;
394 pMonitors[
i].
Size.
cy =
pData->DisplayDeviceList->CurrentSettings->dmPelsHeight;
451 draw->rcItem.left, draw->rcItem.top,
452 draw->rcItem.right - draw->rcItem.left + 1,
453 draw->rcItem.bottom - draw->rcItem.top + 1,
477 case 4: iBitmap = 0;
break;
478 case 8: iBitmap = 1;
break;
479 default: iBitmap = 2;
489 pData->cxSource[iBitmap],
504 DWORD dmNewBitsPerPel;
507 HWND hSpectrumControl;
515 hSpectrumDC =
GetDC(hSpectrumControl);
516 if (hSpectrumDC ==
NULL)
521 ReleaseDC(hSpectrumControl, hSpectrumDC);
524 Current =
pData->CurrentDisplayDevice->CurrentSettings;
533 if (dmNewBitsPerPel < Current->dmBitsPerPel)
535 Current = Current->
Blink;
536 while (Current !=
NULL)
539 && Current->
dmPelsHeight ==
pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight
540 && Current->
dmPelsWidth ==
pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth)
542 pData->CurrentDisplayDevice->CurrentSettings = Current;
546 Current = Current->
Blink;
551 Current = Current->
Flink;
552 while (Current !=
NULL)
555 && Current->
dmPelsHeight ==
pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight
556 && Current->
dmPelsWidth ==
pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth)
558 pData->CurrentDisplayDevice->CurrentSettings = Current;
562 Current = Current->
Flink;
567 Current =
pData->CurrentDisplayDevice->CurrentSettings->
Blink;
568 while (Current !=
NULL)
572 pData->CurrentDisplayDevice->CurrentSettings = Current;
576 Current = Current->
Blink;
580 Current =
pData->CurrentDisplayDevice->CurrentSettings->
Flink;
581 while (Current !=
NULL)
585 pData->CurrentDisplayDevice->CurrentSettings = Current;
589 Current = Current->
Flink;
605 DWORD dmNewPelsWidth =
pData->CurrentDisplayDevice->Resolutions[NewPosition].dmPelsWidth;
607 DWORD dmDisplayFrequency;
610 Current =
pData->CurrentDisplayDevice->CurrentSettings;
624 dmNewPelsHeight, dmBitsPerPel,
625 dmDisplayFrequency) < 0)
627 Current = Current->
Blink;
628 while (Current !=
NULL)
634 pData->CurrentDisplayDevice->CurrentSettings = Current;
638 Current = Current->
Blink;
643 Current = Current->
Flink;
644 while (Current !=
NULL)
650 pData->CurrentDisplayDevice->CurrentSettings = Current;
654 Current = Current->
Flink;
659 Current =
pData->CurrentDisplayDevice->CurrentSettings->
Flink;
660 while (Current !=
NULL)
664 pData->CurrentDisplayDevice->CurrentSettings = Current;
668 Current = Current->
Flink;
672 Current =
pData->CurrentDisplayDevice->CurrentSettings->
Blink;
673 while (Current !=
NULL)
677 pData->CurrentDisplayDevice->CurrentSettings = Current;
681 Current = Current->
Blink;
726 pData->nTimeout = 15;
748 if (
pData->nTimeout == 0)
852 pData->CurrentDisplayDevice->DeviceName,
853 &
pData->CurrentDisplayDevice->InitialSettings,
854 pData->CurrentDisplayDevice->CurrentSettings,
862 pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth =
pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth;
863 pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight =
pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight;
864 pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel =
pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel;
865 pData->CurrentDisplayDevice->InitialSettings.dmDisplayFrequency =
pData->CurrentDisplayDevice->CurrentSettings->dmDisplayFrequency;
869 pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth =
pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth;
870 pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight =
pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight;
871 pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel =
pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel;
872 pData->CurrentDisplayDevice->CurrentSettings->dmDisplayFrequency =
pData->CurrentDisplayDevice->InitialSettings.dmDisplayFrequency;
897 switch (lpDrawItem->
CtlID)
930 pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth =
pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth;
931 pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight =
pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight;
932 pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel =
pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel;
933 pData->CurrentDisplayDevice->CurrentSettings->dmDisplayFrequency =
pData->CurrentDisplayDevice->InitialSettings.dmDisplayFrequency;
970 if (
pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth !=
pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth
971 ||
pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight !=
pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight
972 ||
pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel !=
pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel)
984 Current = Current->
Flink;
1005 if (
pt.x == -1 &&
pt.y == -1)
1095 while (Current !=
NULL)
1099 while (CurrentSettings !=
NULL)
1103 CurrentSettings = NextSettings;
1111 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 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
#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