ReactOS  0.4.15-dev-1152-g6c94e4f
settings.c File Reference
#include "desk.h"
Include dependency graph for settings.c:

Go to the source code of this file.

Classes

struct  _SETTINGS_DATA
 
struct  _TIMEOUTDATA
 

Typedefs

typedef struct _SETTINGS_DATA SETTINGS_DATA
 
typedef struct _SETTINGS_DATAPSETTINGS_DATA
 
typedef struct _TIMEOUTDATA TIMEOUTDATA
 
typedef struct _TIMEOUTDATAPTIMEOUTDATA
 

Functions

static VOID UpdateDisplay (IN HWND hwndDlg, PSETTINGS_DATA pData, IN BOOL bUpdateThumb)
 
static int CompareSettings (PSETTINGS_ENTRY Entry, DWORD dmPelsWidth, DWORD dmPelsHeight, DWORD dmBitsPerPel, DWORD dmDisplayFrequency)
 
static PSETTINGS_ENTRY GetPossibleSettings (IN LPCTSTR DeviceName, OUT DWORD *pSettingsCount, OUT PSETTINGS_ENTRY *CurrentSettings)
 
static BOOL AddDisplayDevice (IN PSETTINGS_DATA pData, IN const DISPLAY_DEVICE *DisplayDevice)
 
static VOID OnDisplayDeviceChanged (IN HWND hwndDlg, IN PSETTINGS_DATA pData, IN PDISPLAY_DEVICE_ENTRY pDeviceEntry)
 
static VOID SettingsOnInitDialog (IN HWND hwndDlg)
 
static VOID ShowColorSpectrum (IN HDC hDC, IN LPRECT client, IN DWORD BitsPerPel, IN PSETTINGS_DATA pData)
 
static VOID OnBPPChanged (IN HWND hwndDlg, IN PSETTINGS_DATA pData)
 
static VOID OnResolutionChanged (IN HWND hwndDlg, IN PSETTINGS_DATA pData, IN DWORD NewPosition, IN BOOL bUpdateThumb)
 
UINT CALLBACK SettingsPageCallbackProc (HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
 
static INT_PTR CALLBACK ConfirmDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static VOID ApplyDisplaySettings (HWND hwndDlg, PSETTINGS_DATA pData)
 
INT_PTR CALLBACK SettingsPageProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 

Typedef Documentation

◆ PSETTINGS_DATA

◆ PTIMEOUTDATA

◆ SETTINGS_DATA

◆ TIMEOUTDATA

Function Documentation

◆ AddDisplayDevice()

static BOOL AddDisplayDevice ( IN PSETTINGS_DATA  pData,
IN const DISPLAY_DEVICE DisplayDevice 
)
static

Definition at line 173 of file settings.c.

174 {
175  PDISPLAY_DEVICE_ENTRY newEntry = NULL;
177  LPTSTR name = NULL;
178  LPTSTR key = NULL;
179  LPTSTR devid = NULL;
180  SIZE_T descriptionSize, nameSize, keySize, devidSize;
181  PSETTINGS_ENTRY Current;
182  DWORD ResolutionsCount = 1;
183  DWORD i;
184 
186  if (!newEntry) goto ByeBye;
187 
188  newEntry->Settings = GetPossibleSettings(DisplayDevice->DeviceName, &newEntry->SettingsCount, &newEntry->CurrentSettings);
189  if (!newEntry->Settings) goto ByeBye;
190 
194 
195  /* Count different resolutions */
196  for (Current = newEntry->Settings; Current != NULL; Current = Current->Flink)
197  {
198  if (Current->Flink != NULL &&
199  ((Current->dmPelsWidth != Current->Flink->dmPelsWidth) ||
200  (Current->dmPelsHeight != Current->Flink->dmPelsHeight)))
201  {
202  ResolutionsCount++;
203  }
204  }
205 
206  newEntry->Resolutions = HeapAlloc(GetProcessHeap(), 0, ResolutionsCount * sizeof(RESOLUTION_INFO));
207  if (!newEntry->Resolutions) goto ByeBye;
208 
209  newEntry->ResolutionsCount = ResolutionsCount;
210 
211  /* Fill resolutions infos */
212  for (Current = newEntry->Settings, i = 0; Current != NULL; Current = Current->Flink)
213  {
214  if (Current->Flink == NULL ||
215  (Current->Flink != NULL &&
216  ((Current->dmPelsWidth != Current->Flink->dmPelsWidth) ||
217  (Current->dmPelsHeight != Current->Flink->dmPelsHeight))))
218  {
219  newEntry->Resolutions[i].dmPelsWidth = Current->dmPelsWidth;
220  newEntry->Resolutions[i].dmPelsHeight = Current->dmPelsHeight;
221  i++;
222  }
223  }
224  descriptionSize = (_tcslen(DisplayDevice->DeviceString) + 1) * sizeof(TCHAR);
225  description = HeapAlloc(GetProcessHeap(), 0, descriptionSize);
226  if (!description) goto ByeBye;
227 
228  nameSize = (_tcslen(DisplayDevice->DeviceName) + 1) * sizeof(TCHAR);
229  name = HeapAlloc(GetProcessHeap(), 0, nameSize);
230  if (!name) goto ByeBye;
231 
232  keySize = (_tcslen(DisplayDevice->DeviceKey) + 1) * sizeof(TCHAR);
233  key = HeapAlloc(GetProcessHeap(), 0, keySize);
234  if (!key) goto ByeBye;
235 
236  devidSize = (_tcslen(DisplayDevice->DeviceID) + 1) * sizeof(TCHAR);
237  devid = HeapAlloc(GetProcessHeap(), 0, devidSize);
238  if (!devid) goto ByeBye;
239 
240  memcpy(description, DisplayDevice->DeviceString, descriptionSize);
241  memcpy(name, DisplayDevice->DeviceName, nameSize);
242  memcpy(key, DisplayDevice->DeviceKey, keySize);
243  memcpy(devid, DisplayDevice->DeviceID, devidSize);
244  newEntry->DeviceDescription = description;
245  newEntry->DeviceName = name;
246  newEntry->DeviceKey = key;
247  newEntry->DeviceID = devid;
248  newEntry->DeviceStateFlags = DisplayDevice->StateFlags;
249  newEntry->Flink = pData->DisplayDeviceList;
250  pData->DisplayDeviceList = newEntry;
251  return TRUE;
252 
253 ByeBye:
254  if (newEntry != NULL)
255  {
256  if (newEntry->Settings != NULL)
257  {
258  Current = newEntry->Settings;
259  while (Current != NULL)
260  {
261  PSETTINGS_ENTRY Next = Current->Flink;
262  HeapFree(GetProcessHeap(), 0, Current);
263  Current = Next;
264  }
265  }
266  if (newEntry->Resolutions != NULL)
267  HeapFree(GetProcessHeap(), 0, newEntry->Resolutions);
268  HeapFree(GetProcessHeap(), 0, newEntry);
269  }
270  if (description != NULL)
272  if (name != NULL)
274  if (key != NULL)
275  HeapFree(GetProcessHeap(), 0, key);
276  return FALSE;
277 }
PSETTINGS_ENTRY CurrentSettings
Definition: precomp.h:79
LPWSTR DeviceKey
Definition: precomp.h:72
SETTINGS_ENTRY InitialSettings
Definition: precomp.h:80
#define TRUE
Definition: types.h:120
struct _DISPLAY_DEVICE_ENTRY * Flink
Definition: precomp.h:69
DWORD dmPelsWidth
Definition: precomp.h:63
Definition: precomp.h:67
LPWSTR DeviceName
Definition: precomp.h:71
DWORD dmBitsPerPel
Definition: precomp.h:62
const char * description
Definition: directx.c:2497
CHAR * LPTSTR
Definition: xmlstorage.h:192
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FALSE
Definition: types.h:117
size_t __cdecl _tcslen(const _TCHAR *str)
Definition: tcslen.h:9
PSETTINGS_ENTRY Settings
Definition: precomp.h:75
smooth NULL
Definition: ftsmooth.c:416
char TCHAR
Definition: xmlstorage.h:189
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static PSETTINGS_ENTRY GetPossibleSettings(IN LPCTSTR DeviceName, OUT DWORD *pSettingsCount, OUT PSETTINGS_ENTRY *CurrentSettings)
Definition: settings.c:88
unsigned long DWORD
Definition: ntddk_ex.h:95
HKEY key
Definition: reg.c:42
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
DWORD DeviceStateFlags
Definition: precomp.h:74
DWORD dmPelsWidth
Definition: precomp.h:54
LPWSTR DeviceID
Definition: precomp.h:73
PRESOLUTION_INFO Resolutions
Definition: precomp.h:77
DWORD dmPelsHeight
Definition: precomp.h:55
ULONG_PTR SIZE_T
Definition: typedefs.h:80
DWORD SettingsCount
Definition: precomp.h:76
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
DWORD ResolutionsCount
Definition: precomp.h:78
DWORD dmPelsHeight
Definition: precomp.h:64
Definition: name.c:38
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
LPWSTR DeviceDescription
Definition: precomp.h:70
Definition: precomp.h:58
#define HeapFree(x, y, z)
Definition: compat.h:483
struct _SETTINGS_ENTRY * Flink
Definition: precomp.h:61
Definition: path.c:41
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by SettingsOnInitDialog().

◆ ApplyDisplaySettings()

static VOID ApplyDisplaySettings ( HWND  hwndDlg,
PSETTINGS_DATA  pData 
)
static

Definition at line 729 of file settings.c.

730 {
731  TCHAR Message[1024], Title[256];
733  LONG rc;
734 
735  RtlZeroMemory(&devmode, sizeof(devmode));
736  devmode.dmSize = (WORD)sizeof(devmode);
737  devmode.dmPelsWidth = pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth;
738  devmode.dmPelsHeight = pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight;
739  devmode.dmBitsPerPel = pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel;
740  devmode.dmDisplayFrequency = pData->CurrentDisplayDevice->CurrentSettings->dmDisplayFrequency;
742 
743  rc = ChangeDisplaySettingsEx(pData->CurrentDisplayDevice->DeviceName,
744  &devmode,
745  NULL,
747  NULL);
748  switch (rc)
749  {
751  break;
752 
753  case DISP_CHANGE_RESTART:
754  LoadString(hApplet, IDS_DISPLAY_SETTINGS, Title, sizeof(Title) / sizeof(TCHAR));
757  return;
758 
759  case DISP_CHANGE_FAILED:
760  default:
761  LoadString(hApplet, IDS_DISPLAY_SETTINGS, Title, sizeof(Title) / sizeof(TCHAR));
762  LoadString(hApplet, IDS_APPLY_FAILED, Message, sizeof(Message) / sizeof (TCHAR));
763  MessageBox(hwndDlg, Message, Title, MB_OK | MB_ICONSTOP);
764  return;
765  }
766 
768  {
769  pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth = pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth;
770  pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight = pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight;
771  pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel = pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel;
772  }
773  else
774  {
775  devmode.dmPelsWidth = pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth;
776  devmode.dmPelsHeight = pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight;
777  devmode.dmBitsPerPel = pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel;
778  devmode.dmDisplayFrequency = pData->CurrentDisplayDevice->InitialSettings.dmDisplayFrequency;
779 
780  rc = ChangeDisplaySettingsEx(pData->CurrentDisplayDevice->DeviceName,
781  &devmode,
782  NULL,
784  NULL);
785  switch (rc)
786  {
788  pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth = pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth;
789  pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight = pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight;
790  pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel = pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel;
791  UpdateDisplay(hwndDlg, pData, TRUE);
792  break;
793 
794  case DISP_CHANGE_RESTART:
795  LoadString(hApplet, IDS_DISPLAY_SETTINGS, Title, sizeof(Title) / sizeof(TCHAR));
798  return;
799 
800  case DISP_CHANGE_FAILED:
801  default:
802  LoadString(hApplet, IDS_DISPLAY_SETTINGS, Title, sizeof(Title) / sizeof(TCHAR));
803  LoadString(hApplet, IDS_APPLY_FAILED, Message, sizeof(Message) / sizeof (TCHAR));
804  MessageBox(hwndDlg, Message, Title, MB_OK | MB_ICONSTOP);
805  return;
806  }
807  }
808 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDYES
Definition: winuser.h:829
#define DISP_CHANGE_RESTART
Definition: winuser.h:191
DWORD dmFields
Definition: wingdi.h:1621
#define TRUE
Definition: types.h:120
HINSTANCE hApplet
Definition: access.c:17
#define MB_ICONSTOP
Definition: winuser.h:797
DWORD dmBitsPerPel
Definition: wingdi.h:1646
#define DM_PELSWIDTH
Definition: wingdi.h:1268
#define DialogBox
Definition: winuser.h:5736
#define CDS_UPDATEREGISTRY
Definition: winuser.h:181
long LONG
Definition: pedump.c:60
#define DISP_CHANGE_FAILED
Definition: winuser.h:194
smooth NULL
Definition: ftsmooth.c:416
#define IDS_APPLY_NEEDS_RESTART
Definition: resource.h:160
char TCHAR
Definition: xmlstorage.h:189
static const WCHAR Title[]
Definition: oid.c:1259
DEVMODEW devmode
#define IDD_CONFIRMSETTINGS
Definition: resource.h:18
WORD dmSize
Definition: wingdi.h:1619
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190
unsigned short WORD
Definition: ntddk_ex.h:93
#define IDS_APPLY_FAILED
Definition: resource.h:159
DWORD dmPelsWidth
Definition: wingdi.h:1647
CHAR Message[80]
Definition: alive.c:5
#define MB_ICONINFORMATION
Definition: winuser.h:796
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1271
#define MessageBox
Definition: winuser.h:5797
static VOID UpdateDisplay(IN HWND hwndDlg, PSETTINGS_DATA pData, IN BOOL bUpdateThumb)
Definition: settings.c:30
DWORD dmDisplayFrequency
Definition: wingdi.h:1653
#define DM_PELSHEIGHT
Definition: wingdi.h:1269
#define MB_OK
Definition: winuser.h:784
#define IDS_DISPLAY_SETTINGS
Definition: resource.h:157
DWORD dmPelsHeight
Definition: wingdi.h:1648
static INT_PTR CALLBACK ConfirmDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: settings.c:666
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define DM_BITSPERPEL
Definition: wingdi.h:1267
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define LoadString
Definition: winuser.h:5794

Referenced by SettingsPageProc().

◆ CompareSettings()

static int CompareSettings ( PSETTINGS_ENTRY  Entry,
DWORD  dmPelsWidth,
DWORD  dmPelsHeight,
DWORD  dmBitsPerPel,
DWORD  dmDisplayFrequency 
)
static

Definition at line 66 of file settings.c.

68 {
69  if (Entry->dmPelsWidth == dmPelsWidth &&
70  Entry->dmPelsHeight == dmPelsHeight &&
71  Entry->dmBitsPerPel == dmBitsPerPel &&
72  Entry->dmDisplayFrequency == dmDisplayFrequency)
73  {
74  return 0;
75  }
76  else
77  if ((Entry->dmPelsWidth < dmPelsWidth) ||
78  (Entry->dmPelsWidth == dmPelsWidth && Entry->dmPelsHeight < dmPelsHeight) ||
79  (Entry->dmPelsWidth == dmPelsWidth && Entry->dmPelsHeight == dmPelsHeight &&
80  Entry->dmBitsPerPel < dmBitsPerPel))
81  {
82  return 1;
83  }
84  return -1;
85 }
base of all file and directory entries
Definition: entries.h:82

Referenced by GetPossibleSettings(), and OnResolutionChanged().

◆ ConfirmDlgProc()

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

Definition at line 666 of file settings.c.

667 {
669 
671 
672  switch(uMsg)
673  {
674  case WM_INITDIALOG:
675  /* Allocate the local dialog data */
677  if (pData == NULL)
678  return FALSE;
679 
680  /* Link the dialog data to the dialog */
682 
683  /* Timeout in seconds */
684  pData->nTimeout = 15;
685 
686  /* Load the raw timeout string */
687  LoadString(hApplet, IDS_TIMEOUTTEXT, pData->szRawBuffer, ARRAYSIZE(pData->szRawBuffer));
688 
689  /* Cook the timeout string and show it */
690  _stprintf(pData->szCookedBuffer, pData->szRawBuffer, pData->nTimeout);
691  SetDlgItemText(hwndDlg, IDC_TIMEOUTTEXT, pData->szCookedBuffer);
692 
693  /* Start the timer (ticks every second)*/
694  SetTimer(hwndDlg, 1, 1000, NULL);
695  break;
696 
697  case WM_TIMER:
698  /* Update the timepout value */
699  pData->nTimeout--;
700 
701  /* Update the timeout text */
702  _stprintf(pData->szCookedBuffer, pData->szRawBuffer, pData->nTimeout);
703  SetDlgItemText(hwndDlg, IDC_TIMEOUTTEXT, pData->szCookedBuffer);
704 
705  /* Kill the timer and return a 'No', if we ran out of time */
706  if (pData->nTimeout == 0)
707  {
708  KillTimer(hwndDlg, 1);
709  EndDialog(hwndDlg, IDNO);
710  }
711  break;
712 
713  case WM_COMMAND:
714  /* Kill the timer and return the clicked button id */
715  KillTimer(hwndDlg, 1);
716  EndDialog(hwndDlg, LOWORD(wParam));
717  break;
718 
719  case WM_DESTROY:
720  /* Free the local dialog data */
722  break;
723  }
724 
725  return FALSE;
726 }
#define IDS_TIMEOUTTEXT
Definition: resource.h:188
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
HINSTANCE hApplet
Definition: access.c:17
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
struct _TIMEOUTDATA * PTIMEOUTDATA
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_DESTROY
Definition: winuser.h:1591
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define WM_TIMER
Definition: winuser.h:1724
#define IDC_TIMEOUTTEXT
Definition: resource.h:187
#define SetDlgItemText
Definition: winuser.h:5824
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1722
#define _stprintf
Definition: utility.h:124
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define IDNO
Definition: winuser.h:830
#define GetWindowLongPtr
Definition: treelist.c:73
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define WM_INITDIALOG
Definition: winuser.h:1721
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:483
#define LoadString
Definition: winuser.h:5794

Referenced by ApplyDisplaySettings().

◆ GetPossibleSettings()

static PSETTINGS_ENTRY GetPossibleSettings ( IN LPCTSTR  DeviceName,
OUT DWORD pSettingsCount,
OUT PSETTINGS_ENTRY CurrentSettings 
)
static

Definition at line 88 of file settings.c.

89 {
91  DWORD NbSettings = 0;
92  DWORD iMode = 0;
93  DWORD dwFlags = 0;
95  HDC hDC;
96  PSETTINGS_ENTRY Current;
97  DWORD bpp, xres, yres;
98  DWORD curDispFreq;
99 
100  /* Get current settings */
101  *CurrentSettings = NULL;
105  xres = GetDeviceCaps(hDC, HORZRES);
106  yres = GetDeviceCaps(hDC, VERTRES);
107  DeleteDC(hDC);
108 
109  /* List all settings */
110  devmode.dmSize = (WORD)sizeof(devmode);
112 
113  if (!EnumDisplaySettingsEx(DeviceName, ENUM_CURRENT_SETTINGS, &devmode, dwFlags))
114  return NULL;
115 
116  curDispFreq = devmode.dmDisplayFrequency;
117 
118  while (EnumDisplaySettingsEx(DeviceName, iMode, &devmode, dwFlags))
119  {
120  iMode++;
121 
122  if (devmode.dmPelsWidth < 640 ||
123  devmode.dmPelsHeight < 480 ||
124  devmode.dmDisplayFrequency != curDispFreq ||
125  (devmode.dmBitsPerPel != 4 &&
126  devmode.dmBitsPerPel != 8 &&
127  devmode.dmBitsPerPel != 16 &&
128  devmode.dmBitsPerPel != 24 &&
129  devmode.dmBitsPerPel != 32))
130  {
131  continue;
132  }
133 
134  Current = HeapAlloc(GetProcessHeap(), 0, sizeof(SETTINGS_ENTRY));
135  if (Current != NULL)
136  {
137  /* Sort resolutions by increasing height, and BPP */
138  PSETTINGS_ENTRY Previous = NULL;
139  PSETTINGS_ENTRY Next = Settings;
140  Current->dmPelsWidth = devmode.dmPelsWidth;
141  Current->dmPelsHeight = devmode.dmPelsHeight;
142  Current->dmBitsPerPel = devmode.dmBitsPerPel;
144  while (Next != NULL &&
148  {
149  Previous = Next;
150  Next = Next->Flink;
151  }
152  Current->Blink = Previous;
153  Current->Flink = Next;
154  if (Previous == NULL)
155  Settings = Current;
156  else
157  Previous->Flink = Current;
158  if (Next != NULL)
159  Next->Blink = Current;
160  if (devmode.dmPelsWidth == xres && devmode.dmPelsHeight == yres && devmode.dmBitsPerPel == bpp)
161  {
162  *CurrentSettings = Current;
163  }
164  NbSettings++;
165  }
166  }
167 
168  *pSettingsCount = NbSettings;
169  return Settings;
170 }
#define BITSPIXEL
Definition: wingdi.h:719
#define HORZRES
Definition: wingdi.h:715
struct _SETTINGS_ENTRY * Blink
Definition: precomp.h:60
DWORD dmDisplayFrequency
Definition: desk.h:85
_In_ ULONG iMode
Definition: winddi.h:3520
DWORD dmPelsWidth
Definition: precomp.h:63
static HDC
Definition: imagelist.c:92
WORD dmDriverExtra
Definition: wingdi.h:1620
static int CompareSettings(PSETTINGS_ENTRY Entry, DWORD dmPelsWidth, DWORD dmPelsHeight, DWORD dmBitsPerPel, DWORD dmDisplayFrequency)
Definition: settings.c:66
SSSTARS Settings
Definition: settings.c:33
DWORD dmBitsPerPel
Definition: precomp.h:62
DWORD dmBitsPerPel
Definition: wingdi.h:1646
WCHAR DeviceName[]
Definition: adapter.cpp:21
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
DEVMODEW devmode
WORD dmSize
Definition: wingdi.h:1619
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dmPelsWidth
Definition: wingdi.h:1647
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
static HDC hDC
Definition: 3dtext.c:33
DWORD dmDisplayFrequency
Definition: wingdi.h:1653
BOOL WINAPI DeleteDC(_In_ HDC)
#define VERTRES
Definition: wingdi.h:716
DWORD dmPelsHeight
Definition: wingdi.h:1648
DWORD dmPelsHeight
Definition: precomp.h:64
#define CreateIC
Definition: wingdi.h:4445
DWORD bpp
Definition: surface.c:182
Definition: precomp.h:58
struct _SETTINGS_ENTRY * Flink
Definition: precomp.h:61
#define PLANES
Definition: wingdi.h:720

Referenced by AddDisplayDevice().

◆ OnBPPChanged()

static VOID OnBPPChanged ( IN HWND  hwndDlg,
IN PSETTINGS_DATA  pData 
)
static

Definition at line 456 of file settings.c.

457 {
458  /* If new BPP is not compatible with resolution:
459  * 1) try to find the nearest smaller matching resolution
460  * 2) otherwise, get the nearest bigger resolution
461  */
462  PSETTINGS_ENTRY Current;
463  DWORD dmNewBitsPerPel;
464  DWORD index;
465  HDC hSpectrumDC;
466  HWND hSpectrumControl;
467  RECT client;
468 
470  dmNewBitsPerPel = (DWORD) SendDlgItemMessage(hwndDlg, IDC_SETTINGS_BPP, CB_GETITEMDATA, index, 0);
471 
472  /* Show a new spectrum bitmap */
473  hSpectrumControl = GetDlgItem(hwndDlg, IDC_SETTINGS_SPECTRUM);
474  hSpectrumDC = GetDC(hSpectrumControl);
475  if (hSpectrumDC == NULL)
476  return;
477 
478  GetClientRect(hSpectrumControl, &client);
479  ShowColorSpectrum(hSpectrumDC, &client, dmNewBitsPerPel, pData);
480  ReleaseDC(hSpectrumControl, hSpectrumDC);
481 
482  /* Find if new parameters are valid */
483  Current = pData->CurrentDisplayDevice->CurrentSettings;
484  if (dmNewBitsPerPel == Current->dmBitsPerPel)
485  {
486  /* No change */
487  return;
488  }
489 
490  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
491 
492  if (dmNewBitsPerPel < Current->dmBitsPerPel)
493  {
494  Current = Current->Blink;
495  while (Current != NULL)
496  {
497  if (Current->dmBitsPerPel == dmNewBitsPerPel
498  && Current->dmPelsHeight == pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight
499  && Current->dmPelsWidth == pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth)
500  {
501  pData->CurrentDisplayDevice->CurrentSettings = Current;
502  UpdateDisplay(hwndDlg, pData, TRUE);
503  return;
504  }
505  Current = Current->Blink;
506  }
507  }
508  else
509  {
510  Current = Current->Flink;
511  while (Current != NULL)
512  {
513  if (Current->dmBitsPerPel == dmNewBitsPerPel
514  && Current->dmPelsHeight == pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight
515  && Current->dmPelsWidth == pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth)
516  {
517  pData->CurrentDisplayDevice->CurrentSettings = Current;
518  UpdateDisplay(hwndDlg, pData, TRUE);
519  return;
520  }
521  Current = Current->Flink;
522  }
523  }
524 
525  /* Search smaller resolution compatible with current color depth */
526  Current = pData->CurrentDisplayDevice->CurrentSettings->Blink;
527  while (Current != NULL)
528  {
529  if (Current->dmBitsPerPel == dmNewBitsPerPel)
530  {
531  pData->CurrentDisplayDevice->CurrentSettings = Current;
532  UpdateDisplay(hwndDlg, pData, TRUE);
533  return;
534  }
535  Current = Current->Blink;
536  }
537 
538  /* Search bigger resolution compatible with current color depth */
539  Current = pData->CurrentDisplayDevice->CurrentSettings->Flink;
540  while (Current != NULL)
541  {
542  if (Current->dmBitsPerPel == dmNewBitsPerPel)
543  {
544  pData->CurrentDisplayDevice->CurrentSettings = Current;
545  UpdateDisplay(hwndDlg, pData, TRUE);
546  return;
547  }
548  Current = Current->Flink;
549  }
550 
551  /* We shouldn't go there */
552 }
struct _SETTINGS_ENTRY * Blink
Definition: precomp.h:60
HDC WINAPI GetDC(_In_opt_ HWND)
#define TRUE
Definition: types.h:120
#define CB_GETITEMDATA
Definition: winuser.h:1932
DWORD dmPelsWidth
Definition: precomp.h:63
static HDC
Definition: imagelist.c:92
#define SendDlgItemMessage
Definition: winuser.h:5817
DWORD dmBitsPerPel
Definition: precomp.h:62
#define DWORD
Definition: nt_native.h:44
#define CB_GETCURSEL
Definition: winuser.h:1925
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
static FILE * client
Definition: client.c:41
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDC_SETTINGS_SPECTRUM
Definition: resource.h:67
#define index(s, c)
Definition: various.h:29
static VOID UpdateDisplay(IN HWND hwndDlg, PSETTINGS_DATA pData, IN BOOL bUpdateThumb)
Definition: settings.c:30
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
static VOID ShowColorSpectrum(IN HDC hDC, IN LPRECT client, IN DWORD BitsPerPel, IN PSETTINGS_DATA pData)
Definition: settings.c:424
#define IDC_SETTINGS_BPP
Definition: resource.h:62
DWORD dmPelsHeight
Definition: precomp.h:64
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
Definition: precomp.h:58
struct _SETTINGS_ENTRY * Flink
Definition: precomp.h:61

Referenced by SettingsPageProc().

◆ OnDisplayDeviceChanged()

static VOID OnDisplayDeviceChanged ( IN HWND  hwndDlg,
IN PSETTINGS_DATA  pData,
IN PDISPLAY_DEVICE_ENTRY  pDeviceEntry 
)
static

Definition at line 280 of file settings.c.

281 {
282  PSETTINGS_ENTRY Current;
283  DWORD index;
284 
285  pData->CurrentDisplayDevice = pDeviceEntry; /* Update variable */
286 
287  /* Fill color depths combo box */
289  for (Current = pDeviceEntry->Settings; Current != NULL; Current = Current->Flink)
290  {
291  TCHAR Buffer[64];
292  if (LoadString(hApplet, (2900 + Current->dmBitsPerPel), Buffer, sizeof(Buffer) / sizeof(TCHAR)))
293  {
295  if (index == (DWORD)CB_ERR)
296  {
299  }
300  }
301  }
302 
303  /* Fill resolutions slider */
305  SendDlgItemMessage(hwndDlg, IDC_SETTINGS_RESOLUTION, TBM_SETRANGE, TRUE, MAKELONG(0, pDeviceEntry->ResolutionsCount - 1));
306 
307  UpdateDisplay(hwndDlg, pData, TRUE);
308 }
#define CB_SETITEMDATA
Definition: winuser.h:1948
#define TRUE
Definition: types.h:120
#define TBM_SETRANGE
Definition: commctrl.h:2033
HINSTANCE hApplet
Definition: access.c:17
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5817
DWORD dmBitsPerPel
Definition: precomp.h:62
#define IDC_SETTINGS_RESOLUTION
Definition: resource.h:63
#define DWORD
Definition: nt_native.h:44
#define CB_ADDSTRING
Definition: winuser.h:1918
#define MAKELONG(a, b)
Definition: typedefs.h:249
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
Definition: bufpool.h:45
GLuint index
Definition: glext.h:6031
#define CB_RESETCONTENT
Definition: winuser.h:1941
#define CB_ERR
Definition: winuser.h:2410
char TCHAR
Definition: xmlstorage.h:189
unsigned long DWORD
Definition: ntddk_ex.h:95
#define index(s, c)
Definition: various.h:29
static VOID UpdateDisplay(IN HWND hwndDlg, PSETTINGS_DATA pData, IN BOOL bUpdateThumb)
Definition: settings.c:30
#define IDC_SETTINGS_BPP
Definition: resource.h:62
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
Definition: precomp.h:58
#define TBM_CLEARTICS
Definition: commctrl.h:2036
#define LoadString
Definition: winuser.h:5794
struct _SETTINGS_ENTRY * Flink
Definition: precomp.h:61
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1922

Referenced by SettingsOnInitDialog().

◆ OnResolutionChanged()

static VOID OnResolutionChanged ( IN HWND  hwndDlg,
IN PSETTINGS_DATA  pData,
IN DWORD  NewPosition,
IN BOOL  bUpdateThumb 
)
static

Definition at line 555 of file settings.c.

557 {
558  /* If new resolution is not compatible with color depth:
559  * 1) try to find the nearest bigger matching color depth
560  * 2) otherwise, get the nearest smaller color depth
561  */
562  PSETTINGS_ENTRY Current;
563  DWORD dmNewPelsHeight = pData->CurrentDisplayDevice->Resolutions[NewPosition].dmPelsHeight;
564  DWORD dmNewPelsWidth = pData->CurrentDisplayDevice->Resolutions[NewPosition].dmPelsWidth;
565  DWORD dmBitsPerPel;
566  DWORD dmDisplayFrequency;
567 
568  /* Find if new parameters are valid */
569  Current = pData->CurrentDisplayDevice->CurrentSettings;
570  if (dmNewPelsHeight == Current->dmPelsHeight && dmNewPelsWidth == Current->dmPelsWidth)
571  {
572  /* No change */
573  return;
574  }
575 
576  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
577 
578  dmBitsPerPel = Current->dmBitsPerPel;
579  dmDisplayFrequency = Current->dmDisplayFrequency;
580 
581  if (CompareSettings(Current, dmNewPelsWidth,
582  dmNewPelsHeight, dmBitsPerPel,
583  dmDisplayFrequency) < 0)
584  {
585  Current = Current->Blink;
586  while (Current != NULL)
587  {
588  if (Current->dmPelsHeight == dmNewPelsHeight
589  && Current->dmPelsWidth == dmNewPelsWidth
590  && Current->dmBitsPerPel == dmBitsPerPel)
591  {
592  pData->CurrentDisplayDevice->CurrentSettings = Current;
593  UpdateDisplay(hwndDlg, pData, bUpdateThumb);
594  return;
595  }
596  Current = Current->Blink;
597  }
598  }
599  else
600  {
601  Current = Current->Flink;
602  while (Current != NULL)
603  {
604  if (Current->dmPelsHeight == dmNewPelsHeight
605  && Current->dmPelsWidth == dmNewPelsWidth
606  && Current->dmBitsPerPel == dmBitsPerPel)
607  {
608  pData->CurrentDisplayDevice->CurrentSettings = Current;
609  UpdateDisplay(hwndDlg, pData, bUpdateThumb);
610  return;
611  }
612  Current = Current->Flink;
613  }
614  }
615 
616  /* Search bigger color depth compatible with current resolution */
617  Current = pData->CurrentDisplayDevice->CurrentSettings->Flink;
618  while (Current != NULL)
619  {
620  if (dmNewPelsHeight == Current->dmPelsHeight && dmNewPelsWidth == Current->dmPelsWidth)
621  {
622  pData->CurrentDisplayDevice->CurrentSettings = Current;
623  UpdateDisplay(hwndDlg, pData, bUpdateThumb);
624  return;
625  }
626  Current = Current->Flink;
627  }
628 
629  /* Search smaller color depth compatible with current resolution */
630  Current = pData->CurrentDisplayDevice->CurrentSettings->Blink;
631  while (Current != NULL)
632  {
633  if (dmNewPelsHeight == Current->dmPelsHeight && dmNewPelsWidth == Current->dmPelsWidth)
634  {
635  pData->CurrentDisplayDevice->CurrentSettings = Current;
636  UpdateDisplay(hwndDlg, pData, bUpdateThumb);
637  return;
638  }
639  Current = Current->Blink;
640  }
641 
642  /* We shouldn't go there */
643 }
struct _SETTINGS_ENTRY * Blink
Definition: precomp.h:60
DWORD dmDisplayFrequency
Definition: desk.h:85
DWORD dmPelsWidth
Definition: precomp.h:63
static int CompareSettings(PSETTINGS_ENTRY Entry, DWORD dmPelsWidth, DWORD dmPelsHeight, DWORD dmBitsPerPel, DWORD dmDisplayFrequency)
Definition: settings.c:66
DWORD dmBitsPerPel
Definition: precomp.h:62
smooth NULL
Definition: ftsmooth.c:416
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
unsigned long DWORD
Definition: ntddk_ex.h:95
static VOID UpdateDisplay(IN HWND hwndDlg, PSETTINGS_DATA pData, IN BOOL bUpdateThumb)
Definition: settings.c:30
HWND WINAPI GetParent(_In_ HWND)
DWORD dmPelsHeight
Definition: precomp.h:64
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
Definition: precomp.h:58
struct _SETTINGS_ENTRY * Flink
Definition: precomp.h:61

Referenced by SettingsPageProc().

◆ SettingsOnInitDialog()

static VOID SettingsOnInitDialog ( IN HWND  hwndDlg)
static

Definition at line 311 of file settings.c.

312 {
313  BITMAP bitmap;
314  DWORD Result = 0;
315  DWORD iDevNum = 0;
316  DWORD i;
317  DISPLAY_DEVICE displayDevice;
319 
320  pData = HeapAlloc(GetProcessHeap(), 0, sizeof(SETTINGS_DATA));
321  if (pData == NULL)
322  return;
323 
325 
326  /* Get video cards list */
327  pData->DisplayDeviceList = NULL;
328  displayDevice.cb = sizeof(displayDevice);
329  while (EnumDisplayDevices(NULL, iDevNum, &displayDevice, 0x1))
330  {
331  if ((displayDevice.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP) != 0)
332  {
333  if (AddDisplayDevice(pData, &displayDevice))
334  Result++;
335  }
336  iDevNum++;
337  }
338 
339  if (Result == 0)
340  {
341  /* No adapter found */
347 
348  /* Do not initialize the color spectrum bitmaps */
349  memset(pData->hSpectrumBitmaps, 0, sizeof(pData->hSpectrumBitmaps));
350  return;
351  }
352  else if (Result == 1)
353  {
355 
356  /* Single video adapter */
357  SendDlgItemMessage(hwndDlg, IDC_SETTINGS_DEVICE, WM_SETTEXT, 0, (LPARAM)pData->DisplayDeviceList->DeviceDescription);
358  OnDisplayDeviceChanged(hwndDlg, pData, pData->DisplayDeviceList);
359 
360  monitors.Position.x = monitors.Position.y = 0;
361  monitors.Size.cx = pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth;
362  monitors.Size.cy = pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight;
363  monitors.Flags = 0;
364  SendDlgItemMessage(hwndDlg,
367  1,
368  (LPARAM)&monitors);
369  }
370  else /* FIXME: Incomplete! */
371  {
372  PMONSL_MONINFO pMonitors;
373  DWORD i;
374 
375  SendDlgItemMessage(hwndDlg, IDC_SETTINGS_DEVICE, WM_SETTEXT, 0, (LPARAM)pData->DisplayDeviceList->DeviceDescription);
376  OnDisplayDeviceChanged(hwndDlg, pData, pData->DisplayDeviceList);
377 
378  pMonitors = (PMONSL_MONINFO)HeapAlloc(GetProcessHeap(), 0, sizeof(MONSL_MONINFO) * Result);
379  if (pMonitors)
380  {
381  DWORD hack = 1280;
382  for (i = 0; i < Result; i++)
383  {
384  pMonitors[i].Position.x = hack * i;
385  pMonitors[i].Position.y = 0;
386  pMonitors[i].Size.cx = pData->DisplayDeviceList->CurrentSettings->dmPelsWidth;
387  pMonitors[i].Size.cy = pData->DisplayDeviceList->CurrentSettings->dmPelsHeight;
388  pMonitors[i].Flags = 0;
389  }
390 
391  SendDlgItemMessage(hwndDlg,
394  Result,
395  (LPARAM)pMonitors);
396 
397  HeapFree(GetProcessHeap(), 0, pMonitors);
398  }
399  }
400 
401  /* Initialize the color spectrum bitmaps */
402  for (i = 0; i < NUM_SPECTRUM_BITMAPS; i++)
403  {
405 
406  if (pData->hSpectrumBitmaps[i] != NULL)
407  {
408  if (GetObjectW(pData->hSpectrumBitmaps[i], sizeof(BITMAP), &bitmap) != 0)
409  {
410  pData->cxSource[i] = bitmap.bmWidth;
411  pData->cySource[i] = bitmap.bmHeight;
412  }
413  else
414  {
415  pData->cxSource[i] = 0;
416  pData->cySource[i] = 0;
417  }
418  }
419  }
420 }
#define IDC_SETTINGS_DEVICE
Definition: resource.h:61
#define IDC_SETTINGS_RESOLUTION_TEXT
Definition: resource.h:21
struct _MONSL_MONINFO * PMONSL_MONINFO
#define MSLM_SETMONITORSINFO
Definition: monslctl.h:89
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define SW_HIDE
Definition: winuser.h:762
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
HINSTANCE hApplet
Definition: access.c:17
#define SendDlgItemMessage
Definition: winuser.h:5817
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define IDC_SETTINGS_RESOLUTION
Definition: resource.h:63
#define SetWindowLongPtr
Definition: treelist.c:70
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FALSE
Definition: types.h:117
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
smooth NULL
Definition: ftsmooth.c:416
struct _MONSL_MONINFO MONSL_MONINFO
_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:426
LONG cx
Definition: windef.h:334
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_SETTEXT
Definition: winuser.h:1599
#define IDC_SETTINGS_ADVANCED
Definition: resource.h:65
Definition: uimain.c:88
DWORD Flags
Definition: monslctl.h:19
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
Definition: wingdi.h:1395
static BOOL AddDisplayDevice(IN PSETTINGS_DATA pData, IN const DISPLAY_DEVICE *DisplayDevice)
Definition: settings.c:173
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint * monitors
Definition: glext.h:11118
#define IDC_SETTINGS_SPECTRUM
Definition: resource.h:67
#define IDC_SETTINGS_MONSEL
Definition: resource.h:66
#define DWLP_USER
Definition: winuser.h:866
#define NUM_SPECTRUM_BITMAPS
Definition: desk.h:67
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
DWORD StateFlags
Definition: wingdi.h:2811
#define IDB_SPECTRUM_4
Definition: resource.h:69
Definition: bl.h:1331
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define IMAGE_BITMAP
Definition: winuser.h:211
#define IDC_SETTINGS_BPP
Definition: resource.h:62
static HBITMAP bitmap
Definition: clipboard.c:1344
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
#define memset(x, y, z)
Definition: compat.h:39
LONG cy
Definition: windef.h:335
POINT Position
Definition: monslctl.h:17
#define HeapFree(x, y, z)
Definition: compat.h:483
static VOID OnDisplayDeviceChanged(IN HWND hwndDlg, IN PSETTINGS_DATA pData, IN PDISPLAY_DEVICE_ENTRY pDeviceEntry)
Definition: settings.c:280

Referenced by SettingsPageProc().

◆ SettingsPageCallbackProc()

UINT CALLBACK SettingsPageCallbackProc ( HWND  hwnd,
UINT  uMsg,
LPPROPSHEETPAGE  ppsp 
)

Definition at line 647 of file settings.c.

648 {
649  UINT Ret = 0;
650 
651  switch (uMsg)
652  {
653  case PSPCB_CREATE:
655  break;
656 
657  case PSPCB_RELEASE:
659  break;
660  }
661 
662  return Ret;
663 }
HINSTANCE hApplet
Definition: access.c:17
VOID UnregisterMonitorSelectionControl(IN HINSTANCE hInstance)
Definition: monslctl.c:1655
#define PSPCB_RELEASE
Definition: prsht.h:37
#define PSPCB_CREATE
Definition: prsht.h:38
unsigned int UINT
Definition: ndis.h:50
BOOL RegisterMonitorSelectionControl(IN HINSTANCE hInstance)
Definition: monslctl.c:1638

◆ SettingsPageProc()

INT_PTR CALLBACK SettingsPageProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)

Definition at line 812 of file settings.c.

813 {
815 
817 
818  switch(uMsg)
819  {
820  case WM_INITDIALOG:
821  {
822  SettingsOnInitDialog(hwndDlg);
823  break;
824  }
825  case WM_DRAWITEM:
826  {
827  LPDRAWITEMSTRUCT lpDrawItem;
828  lpDrawItem = (LPDRAWITEMSTRUCT) lParam;
829 
830  if (lpDrawItem->CtlID == IDC_SETTINGS_SPECTRUM)
831  ShowColorSpectrum(lpDrawItem->hDC, &lpDrawItem->rcItem, pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel, pData);
832  break;
833  }
834  case WM_COMMAND:
835  {
836  DWORD controlId = LOWORD(wParam);
838 
839  if (controlId == IDC_SETTINGS_ADVANCED && command == BN_CLICKED)
840  DisplayAdvancedSettings(hwndDlg, pData->CurrentDisplayDevice);
841  else if (controlId == IDC_SETTINGS_BPP && command == CBN_SELCHANGE)
842  OnBPPChanged(hwndDlg, pData);
843  break;
844  }
845  case WM_HSCROLL:
846  {
847  switch (LOWORD(wParam))
848  {
849  case TB_LINEUP:
850  case TB_LINEDOWN:
851  case TB_PAGEUP:
852  case TB_PAGEDOWN:
853  case TB_TOP:
854  case TB_BOTTOM:
855  case TB_ENDTRACK:
856  {
857  DWORD newPosition = (DWORD) SendDlgItemMessage(hwndDlg, IDC_SETTINGS_RESOLUTION, TBM_GETPOS, 0, 0);
858  OnResolutionChanged(hwndDlg, pData, newPosition, TRUE);
859  break;
860  }
861 
862  case TB_THUMBTRACK:
864  break;
865  }
866  break;
867  }
868  case WM_NOTIFY:
869  {
870  LPNMHDR lpnm = (LPNMHDR)lParam;
871  if (lpnm->code == (UINT)PSN_APPLY)
872  {
873  if (pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth != pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth
874  || pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight != pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight
875  || pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel != pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel)
876  {
877  /* Apply new settings */
878  ApplyDisplaySettings(hwndDlg, pData);
879  }
880  }
881  break;
882  }
883 
884  case WM_CONTEXTMENU:
885  {
886  HWND hwndMonSel;
887  HMENU hPopup;
888  UINT uiCmd;
889  POINT pt, ptClient;
890  INT Index;
891 
892  pt.x = (SHORT)LOWORD(lParam);
893  pt.y = (SHORT)HIWORD(lParam);
894 
895  hwndMonSel = GetDlgItem(hwndDlg,
897  if ((HWND)wParam == hwndMonSel)
898  {
899  if (pt.x == -1 && pt.y == -1)
900  {
901  RECT rcMon;
902 
903  Index = (INT)SendMessage(hwndMonSel,
905  0,
906  0);
907 
908  if (Index >= 0 &&
909  (INT)SendMessage(hwndMonSel,
911  Index,
912  (LPARAM)&rcMon) > 0)
913  {
914  pt.x = rcMon.left + ((rcMon.right - rcMon.left) / 2);
915  pt.y = rcMon.top + ((rcMon.bottom - rcMon.top) / 2);
916  }
917  else
918  pt.x = pt.y = 0;
919 
920  MapWindowPoints(hwndMonSel,
921  NULL,
922  &pt,
923  1);
924  }
925  else
926  {
927  ptClient = pt;
929  hwndMonSel,
930  &ptClient,
931  1);
932 
933  Index = (INT)SendMessage(hwndMonSel,
934  MSLM_HITTEST,
935  (WPARAM)&ptClient,
936  0);
937  }
938 
939  if (Index >= 0)
940  {
941  hPopup = LoadPopupMenu(hApplet,
943  if (hPopup != NULL)
944  {
945  /* FIXME: Enable/Disable menu items */
946  EnableMenuItem(hPopup,
949  EnableMenuItem(hPopup,
952  EnableMenuItem(hPopup,
955  EnableMenuItem(hPopup,
958 
959  uiCmd = (UINT)TrackPopupMenu(hPopup,
961  pt.x,
962  pt.y,
963  0,
964  hwndDlg,
965  NULL);
966 
967  switch (uiCmd)
968  {
969  case ID_MENU_ATTACHED:
970  case ID_MENU_PRIMARY:
971  case ID_MENU_IDENTIFY:
972  case ID_MENU_PROPERTIES:
973  /* FIXME: Implement */
974  break;
975  }
976 
977  DestroyMenu(hPopup);
978  }
979  }
980  }
981  break;
982  }
983 
984  case WM_DESTROY:
985  {
986  DWORD i;
987  PDISPLAY_DEVICE_ENTRY Current = pData->DisplayDeviceList;
988 
989  while (Current != NULL)
990  {
991  PDISPLAY_DEVICE_ENTRY Next = Current->Flink;
992  PSETTINGS_ENTRY CurrentSettings = Current->Settings;
993  while (CurrentSettings != NULL)
994  {
995  PSETTINGS_ENTRY NextSettings = CurrentSettings->Flink;
996  HeapFree(GetProcessHeap(), 0, CurrentSettings);
997  CurrentSettings = NextSettings;
998  }
999  HeapFree(GetProcessHeap(), 0, Current);
1000  Current = Next;
1001  }
1002 
1003  for (i = 0; i < NUM_SPECTRUM_BITMAPS; i++)
1004  {
1005  if (pData->hSpectrumBitmaps[i])
1006  DeleteObject(pData->hSpectrumBitmaps[i]);
1007  }
1008 
1009  HeapFree(GetProcessHeap(), 0, pData);
1010  }
1011  }
1012  return FALSE;
1013 }
#define TB_THUMBTRACK
Definition: commctrl.h:2074
#define MAKEINTRESOURCE
Definition: winuser.h:591
static VOID OnResolutionChanged(IN HWND hwndDlg, IN PSETTINGS_DATA pData, IN DWORD NewPosition, IN BOOL bUpdateThumb)
Definition: settings.c:555
#define MF_DISABLED
Definition: winuser.h:130
#define TB_PAGEDOWN
Definition: commctrl.h:2072
#define MF_BYCOMMAND
Definition: winuser.h:202
#define WM_CONTEXTMENU
Definition: richedit.h:64
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
struct _DISPLAY_DEVICE_ENTRY * Flink
Definition: precomp.h:69
#define ID_MENU_PRIMARY
Definition: resource.h:80
BOOL DisplayAdvancedSettings(HWND hWndParent, PDISPLAY_DEVICE_ENTRY DisplayDevice)
Definition: advmon.c:81
#define TPM_RETURNCMD
Definition: winuser.h:2362
#define INT
Definition: polytest.cpp:20
LONG top
Definition: windef.h:307
Definition: precomp.h:67
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HINSTANCE hApplet
Definition: access.c:17
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5817
#define PSN_APPLY
Definition: prsht.h:117
LONG left
Definition: windef.h:306
#define IDC_SETTINGS_RESOLUTION
Definition: resource.h:63
LONG right
Definition: windef.h:308
#define ID_MENU_IDENTIFY
Definition: resource.h:81
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:58
WPARAM wParam
Definition: combotst.c:138
struct tagNMHDR * LPNMHDR
#define TB_PAGEUP
Definition: commctrl.h:2071
#define TB_LINEDOWN
Definition: commctrl.h:2070
UINT code
Definition: winuser.h:3134
#define MSLM_GETMONITORRECT
Definition: monslctl.h:212
#define TB_BOTTOM
Definition: commctrl.h:2076
#define TPM_RIGHTBUTTON
Definition: winuser.h:2355
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
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define FALSE
Definition: types.h:117
#define TBM_GETPOS
Definition: commctrl.h:2027
short SHORT
Definition: pedump.c:59
static VOID SettingsOnInitDialog(IN HWND hwndDlg)
Definition: settings.c:311
PSETTINGS_ENTRY Settings
Definition: precomp.h:75
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define IDC_SETTINGS_ADVANCED
Definition: resource.h:65
#define WM_DESTROY
Definition: winuser.h:1591
#define GetProcessHeap()
Definition: compat.h:484
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
static const UCHAR Index[8]
Definition: usbohci.c:18
#define BN_CLICKED
Definition: winuser.h:1907
unsigned long DWORD
Definition: ntddk_ex.h:95
static VOID ApplyDisplaySettings(HWND hwndDlg, PSETTINGS_DATA pData)
Definition: settings.c:729
#define MSLM_GETCURSEL
Definition: monslctl.h:139
static VOID OnBPPChanged(IN HWND hwndDlg, IN PSETTINGS_DATA pData)
Definition: settings.c:456
#define TB_LINEUP
Definition: commctrl.h:2069
#define TB_ENDTRACK
Definition: commctrl.h:2077
#define TB_TOP
Definition: commctrl.h:2075
#define IDC_SETTINGS_SPECTRUM
Definition: resource.h:67
#define IDC_SETTINGS_MONSEL
Definition: resource.h:66
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1722
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define NUM_SPECTRUM_BITMAPS
Definition: desk.h:67
#define ID_MENU_PROPERTIES
Definition: resource.h:82
HMENU LoadPopupMenu(IN HINSTANCE hInstance, IN LPCWSTR lpMenuName)
Definition: util.cpp:33
#define IDM_MONITOR_MENU
Definition: resource.h:78
#define ID_MENU_ATTACHED
Definition: resource.h:79
unsigned int UINT
Definition: ndis.h:50
#define WM_HSCROLL
Definition: winuser.h:1725
#define CBN_SELCHANGE
Definition: winuser.h:1961
static VOID ShowColorSpectrum(IN HDC hDC, IN LPRECT client, IN DWORD BitsPerPel, IN PSETTINGS_DATA pData)
Definition: settings.c:424
#define WM_DRAWITEM
Definition: winuser.h:1627
#define IDC_SETTINGS_BPP
Definition: resource.h:62
#define SendMessage
Definition: winuser.h:5818
#define MSLM_HITTEST
Definition: monslctl.h:120
struct _SETTINGS_DATA * PSETTINGS_DATA
#define HIWORD(l)
Definition: typedefs.h:247
LONG bottom
Definition: windef.h:309
#define GetWindowLongPtr
Definition: treelist.c:73
#define MF_GRAYED
Definition: winuser.h:129
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
Definition: precomp.h:58
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:483
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETTINGS_ENTRY * Flink
Definition: precomp.h:61

◆ ShowColorSpectrum()

static VOID ShowColorSpectrum ( IN HDC  hDC,
IN LPRECT  client,
IN DWORD  BitsPerPel,
IN PSETTINGS_DATA  pData 
)
static

Definition at line 424 of file settings.c.

425 {
426  HDC hdcMem;
427  INT iBitmap;
428 
430 
431  if (!hdcMem)
432  return;
433 
434  switch(BitsPerPel)
435  {
436  case 4: iBitmap = 0; break;
437  case 8: iBitmap = 1; break;
438  default: iBitmap = 2;
439  }
440 
441  if (SelectObject(hdcMem, pData->hSpectrumBitmaps[iBitmap]))
442  {
443  StretchBlt(hDC,
444  client->left, client->top,
445  client->right - client->left,
446  client->bottom - client->top,
447  hdcMem, 0, 0,
448  pData->cxSource[iBitmap],
449  pData->cySource[iBitmap], SRCCOPY);
450  }
451 
452  DeleteDC(hdcMem);
453 }
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
int32_t INT
Definition: typedefs.h:58
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)
static FILE * client
Definition: client.c:41
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI DeleteDC(_In_ HDC)
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define SRCCOPY
Definition: wingdi.h:332
HDC hdcMem
Definition: welcome.c:104

Referenced by OnBPPChanged(), and SettingsPageProc().

◆ UpdateDisplay()

static VOID UpdateDisplay ( IN HWND  hwndDlg,
PSETTINGS_DATA  pData,
IN BOOL  bUpdateThumb 
)
static

Definition at line 30 of file settings.c.

31 {
32  TCHAR Buffer[64];
33  TCHAR Pixel[64];
34  DWORD index;
35  HWND hwndMonSel;
37 
38  LoadString(hApplet, IDS_PIXEL, Pixel, sizeof(Pixel) / sizeof(TCHAR));
39  _stprintf(Buffer, Pixel, pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth, pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight, Pixel);
41 
42  for (index = 0; index < pData->CurrentDisplayDevice->ResolutionsCount; index++)
43  {
44  if (pData->CurrentDisplayDevice->Resolutions[index].dmPelsWidth == pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth &&
45  pData->CurrentDisplayDevice->Resolutions[index].dmPelsHeight == pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight)
46  {
47  if (bUpdateThumb)
49  break;
50  }
51  }
52  if (LoadString(hApplet, (2900 + pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel), Buffer, sizeof(Buffer) / sizeof(TCHAR)))
54 
55  hwndMonSel = GetDlgItem(hwndDlg, IDC_SETTINGS_MONSEL);
56  index = (INT)SendMessage(hwndMonSel, MSLM_GETCURSEL, 0, 0);
57  if (index != (DWORD)-1 && SendMessage(hwndMonSel, MSLM_GETMONITORINFO, index, (LPARAM)&info))
58  {
59  info.Size.cx = pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth;
60  info.Size.cy = pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight;
62  }
63 }
#define IDC_SETTINGS_RESOLUTION_TEXT
Definition: resource.h:21
#define TRUE
Definition: types.h:120
#define MSLM_SETMONITORINFO
Definition: monslctl.h:150
#define INT
Definition: polytest.cpp:20
#define TBM_SETPOS
Definition: commctrl.h:2032
HINSTANCE hApplet
Definition: access.c:17
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5817
#define IDC_SETTINGS_RESOLUTION
Definition: resource.h:63
struct _test_info info[]
Definition: SetCursorPos.c:19
#define IDS_PIXEL
Definition: resource.h:41
LONG_PTR LPARAM
Definition: windef.h:208
Definition: bufpool.h:45
GLuint index
Definition: glext.h:6031
#define WM_SETTEXT
Definition: winuser.h:1599
char TCHAR
Definition: xmlstorage.h:189
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MSLM_GETCURSEL
Definition: monslctl.h:139
#define index(s, c)
Definition: various.h:29
#define IDC_SETTINGS_MONSEL
Definition: resource.h:66
#define CB_SELECTSTRING
Definition: winuser.h:1942
#define _stprintf
Definition: utility.h:124
#define IDC_SETTINGS_BPP
Definition: resource.h:62
#define SendMessage
Definition: winuser.h:5818
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define MSLM_GETMONITORINFO
Definition: monslctl.h:161
#define LoadString
Definition: winuser.h:5794

Referenced by ApplyDisplaySettings(), OnBPPChanged(), OnDisplayDeviceChanged(), and OnResolutionChanged().