ReactOS  0.4.13-dev-242-g611e6d7
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
#define TRUE
Definition: types.h:120
LPWSTR DeviceKey
Definition: precomp.h:72
SETTINGS_ENTRY InitialSettings
Definition: precomp.h:80
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:2502
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
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:395
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:78
DWORD SettingsCount
Definition: precomp.h:76
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
DWORD ResolutionsCount
Definition: precomp.h:78
DWORD dmPelsHeight
Definition: precomp.h:64
Definition: name.c:36
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:394
struct _SETTINGS_ENTRY * Flink
Definition: precomp.h:61
Definition: path.c:42
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by SettingsOnInitDialog().

◆ ApplyDisplaySettings()

static VOID ApplyDisplaySettings ( HWND  hwndDlg,
PSETTINGS_DATA  pData 
)
static

Definition at line 725 of file settings.c.

726 {
727  TCHAR Message[1024], Title[256];
729  LONG rc;
730 
731  RtlZeroMemory(&devmode, sizeof(devmode));
732  devmode.dmSize = (WORD)sizeof(devmode);
733  devmode.dmPelsWidth = pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth;
734  devmode.dmPelsHeight = pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight;
735  devmode.dmBitsPerPel = pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel;
736  devmode.dmDisplayFrequency = pData->CurrentDisplayDevice->CurrentSettings->dmDisplayFrequency;
738 
739  rc = ChangeDisplaySettingsEx(pData->CurrentDisplayDevice->DeviceName,
740  &devmode,
741  NULL,
743  NULL);
744  switch (rc)
745  {
747  break;
748 
749  case DISP_CHANGE_RESTART:
750  LoadString(hApplet, IDS_DISPLAY_SETTINGS, Title, sizeof(Title) / sizeof(TCHAR));
753  return;
754 
755  case DISP_CHANGE_FAILED:
756  default:
757  LoadString(hApplet, IDS_DISPLAY_SETTINGS, Title, sizeof(Title) / sizeof(TCHAR));
758  LoadString(hApplet, IDS_APPLY_FAILED, Message, sizeof(Message) / sizeof (TCHAR));
759  MessageBox(hwndDlg, Message, Title, MB_OK | MB_ICONSTOP);
760  return;
761  }
762 
764  {
765  pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth = pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth;
766  pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight = pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight;
767  pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel = pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel;
768  }
769  else
770  {
771  devmode.dmPelsWidth = pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth;
772  devmode.dmPelsHeight = pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight;
773  devmode.dmBitsPerPel = pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel;
774  devmode.dmDisplayFrequency = pData->CurrentDisplayDevice->InitialSettings.dmDisplayFrequency;
775 
776  rc = ChangeDisplaySettingsEx(pData->CurrentDisplayDevice->DeviceName,
777  &devmode,
778  NULL,
780  NULL);
781  switch (rc)
782  {
784  pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth = pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth;
785  pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight = pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight;
786  pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel = pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel;
787  UpdateDisplay(hwndDlg, pData, TRUE);
788  break;
789 
790  case DISP_CHANGE_RESTART:
791  LoadString(hApplet, IDS_DISPLAY_SETTINGS, Title, sizeof(Title) / sizeof(TCHAR));
794  return;
795 
796  case DISP_CHANGE_FAILED:
797  default:
798  LoadString(hApplet, IDS_DISPLAY_SETTINGS, Title, sizeof(Title) / sizeof(TCHAR));
799  LoadString(hApplet, IDS_APPLY_FAILED, Message, sizeof(Message) / sizeof (TCHAR));
800  MessageBox(hwndDlg, Message, Title, MB_OK | MB_ICONSTOP);
801  return;
802  }
803  }
804 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
#define IDYES
Definition: winuser.h:829
#define DISP_CHANGE_RESTART
Definition: winuser.h:191
DWORD dmFields
Definition: wingdi.h:1600
HINSTANCE hApplet
Definition: access.c:17
#define MB_ICONSTOP
Definition: winuser.h:797
DWORD dmBitsPerPel
Definition: wingdi.h:1625
#define DM_PELSWIDTH
Definition: wingdi.h:1251
#define DialogBox
Definition: winuser.h:5627
#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:152
char TCHAR
Definition: xmlstorage.h:189
static const WCHAR Title[]
Definition: oid.c:1259
DEVMODEW devmode
#define IDD_CONFIRMSETTINGS
Definition: resource.h:17
WORD dmSize
Definition: wingdi.h:1598
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190
unsigned short WORD
Definition: ntddk_ex.h:93
#define IDS_APPLY_FAILED
Definition: resource.h:151
DWORD dmPelsWidth
Definition: wingdi.h:1626
CHAR Message[80]
Definition: alive.c:5
#define MB_ICONINFORMATION
Definition: winuser.h:796
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1254
#define MessageBox
Definition: winuser.h:5688
static VOID UpdateDisplay(IN HWND hwndDlg, PSETTINGS_DATA pData, IN BOOL bUpdateThumb)
Definition: settings.c:30
DWORD dmDisplayFrequency
Definition: wingdi.h:1632
#define DM_PELSHEIGHT
Definition: wingdi.h:1252
#define MB_OK
Definition: winuser.h:784
#define IDS_DISPLAY_SETTINGS
Definition: resource.h:149
DWORD dmPelsHeight
Definition: wingdi.h:1627
static INT_PTR CALLBACK ConfirmDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: settings.c:662
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define DM_BITSPERPEL
Definition: wingdi.h:1250
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define LoadString
Definition: winuser.h:5685

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 662 of file settings.c.

663 {
665 
667 
668  switch(uMsg)
669  {
670  case WM_INITDIALOG:
671  /* Allocate the local dialog data */
673  if (pData == NULL)
674  return FALSE;
675 
676  /* Link the dialog data to the dialog */
678 
679  /* Timeout in seconds */
680  pData->nTimeout = 15;
681 
682  /* Load the raw timeout string */
683  LoadString(hApplet, IDS_TIMEOUTTEXT, pData->szRawBuffer, ARRAYSIZE(pData->szRawBuffer));
684 
685  /* Cook the timeout string and show it */
686  _stprintf(pData->szCookedBuffer, pData->szRawBuffer, pData->nTimeout);
687  SetDlgItemText(hwndDlg, IDC_TIMEOUTTEXT, pData->szCookedBuffer);
688 
689  /* Start the timer (ticks every second)*/
690  SetTimer(hwndDlg, 1, 1000, NULL);
691  break;
692 
693  case WM_TIMER:
694  /* Update the timepout value */
695  pData->nTimeout--;
696 
697  /* Update the timeout text */
698  _stprintf(pData->szCookedBuffer, pData->szRawBuffer, pData->nTimeout);
699  SetDlgItemText(hwndDlg, IDC_TIMEOUTTEXT, pData->szCookedBuffer);
700 
701  /* Kill the timer and return a 'No', if we ran out of time */
702  if (pData->nTimeout == 0)
703  {
704  KillTimer(hwndDlg, 1);
705  EndDialog(hwndDlg, IDNO);
706  }
707  break;
708 
709  case WM_COMMAND:
710  /* Kill the timer and return the clicked button id */
711  KillTimer(hwndDlg, 1);
712  EndDialog(hwndDlg, LOWORD(wParam));
713  break;
714 
715  case WM_DESTROY:
716  /* Free the local dialog data */
718  break;
719  }
720 
721  return FALSE;
722 }
#define IDS_TIMEOUTTEXT
Definition: resource.h:180
#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)
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:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define WM_TIMER
Definition: winuser.h:1718
#define IDC_TIMEOUTTEXT
Definition: resource.h:179
#define SetDlgItemText
Definition: winuser.h:5715
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1716
#define _stprintf
Definition: utility.h:124
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#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:1715
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
#define LoadString
Definition: winuser.h:5685

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:1599
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:1625
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:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
DEVMODEW devmode
WORD dmSize
Definition: wingdi.h:1598
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dmPelsWidth
Definition: wingdi.h:1626
_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:1632
BOOL WINAPI DeleteDC(_In_ HDC)
#define VERTRES
Definition: wingdi.h:716
DWORD dmPelsHeight
Definition: wingdi.h:1627
DWORD dmPelsHeight
Definition: precomp.h:64
#define CreateIC
Definition: wingdi.h:4424
DWORD bpp
Definition: surface.c:181
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  GetClientRect(hSpectrumControl, &client);
476  ShowColorSpectrum(hSpectrumDC, &client, dmNewBitsPerPel, pData);
477 
478  /* Find if new parameters are valid */
479  Current = pData->CurrentDisplayDevice->CurrentSettings;
480  if (dmNewBitsPerPel == Current->dmBitsPerPel)
481  {
482  /* No change */
483  return;
484  }
485 
486  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
487 
488  if (dmNewBitsPerPel < Current->dmBitsPerPel)
489  {
490  Current = Current->Blink;
491  while (Current != NULL)
492  {
493  if (Current->dmBitsPerPel == dmNewBitsPerPel
494  && Current->dmPelsHeight == pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight
495  && Current->dmPelsWidth == pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth)
496  {
497  pData->CurrentDisplayDevice->CurrentSettings = Current;
498  UpdateDisplay(hwndDlg, pData, TRUE);
499  return;
500  }
501  Current = Current->Blink;
502  }
503  }
504  else
505  {
506  Current = Current->Flink;
507  while (Current != NULL)
508  {
509  if (Current->dmBitsPerPel == dmNewBitsPerPel
510  && Current->dmPelsHeight == pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight
511  && Current->dmPelsWidth == pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth)
512  {
513  pData->CurrentDisplayDevice->CurrentSettings = Current;
514  UpdateDisplay(hwndDlg, pData, TRUE);
515  return;
516  }
517  Current = Current->Flink;
518  }
519  }
520 
521  /* Search smaller resolution compatible with current color depth */
522  Current = pData->CurrentDisplayDevice->CurrentSettings->Blink;
523  while (Current != NULL)
524  {
525  if (Current->dmBitsPerPel == dmNewBitsPerPel)
526  {
527  pData->CurrentDisplayDevice->CurrentSettings = Current;
528  UpdateDisplay(hwndDlg, pData, TRUE);
529  return;
530  }
531  Current = Current->Blink;
532  }
533 
534  /* Search bigger resolution compatible with current color depth */
535  Current = pData->CurrentDisplayDevice->CurrentSettings->Flink;
536  while (Current != NULL)
537  {
538  if (Current->dmBitsPerPel == dmNewBitsPerPel)
539  {
540  pData->CurrentDisplayDevice->CurrentSettings = Current;
541  UpdateDisplay(hwndDlg, pData, TRUE);
542  return;
543  }
544  Current = Current->Flink;
545  }
546 
547  /* We shouldn't go there */
548 }
#define TRUE
Definition: types.h:120
struct _SETTINGS_ENTRY * Blink
Definition: precomp.h:60
HDC WINAPI GetDC(_In_opt_ HWND)
#define CB_GETITEMDATA
Definition: winuser.h:1911
DWORD dmPelsWidth
Definition: precomp.h:63
static HDC
Definition: imagelist.c:92
#define SendDlgItemMessage
Definition: winuser.h:5708
DWORD dmBitsPerPel
Definition: precomp.h:62
#define DWORD
Definition: nt_native.h:44
#define CB_GETCURSEL
Definition: winuser.h:1904
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:326
static FILE * client
Definition: client.c:41
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDC_SETTINGS_SPECTRUM
Definition: resource.h:60
#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:55
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:1927
#define TRUE
Definition: types.h:120
#define TBM_SETRANGE
Definition: commctrl.h:2009
HINSTANCE hApplet
Definition: access.c:17
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5708
DWORD dmBitsPerPel
Definition: precomp.h:62
#define IDC_SETTINGS_RESOLUTION
Definition: resource.h:56
#define DWORD
Definition: nt_native.h:44
#define CB_ADDSTRING
Definition: winuser.h:1897
#define MAKELONG(a, b)
Definition: typedefs.h:248
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:1920
#define CB_ERR
Definition: winuser.h:2389
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:55
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:2012
#define LoadString
Definition: winuser.h:5685
struct _SETTINGS_ENTRY * Flink
Definition: precomp.h:61
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1901

Referenced by SettingsOnInitDialog().

◆ OnResolutionChanged()

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

Definition at line 551 of file settings.c.

553 {
554  /* If new resolution is not compatible with color depth:
555  * 1) try to find the nearest bigger matching color depth
556  * 2) otherwise, get the nearest smaller color depth
557  */
558  PSETTINGS_ENTRY Current;
559  DWORD dmNewPelsHeight = pData->CurrentDisplayDevice->Resolutions[NewPosition].dmPelsHeight;
560  DWORD dmNewPelsWidth = pData->CurrentDisplayDevice->Resolutions[NewPosition].dmPelsWidth;
561  DWORD dmBitsPerPel;
562  DWORD dmDisplayFrequency;
563 
564  /* Find if new parameters are valid */
565  Current = pData->CurrentDisplayDevice->CurrentSettings;
566  if (dmNewPelsHeight == Current->dmPelsHeight && dmNewPelsWidth == Current->dmPelsWidth)
567  {
568  /* No change */
569  return;
570  }
571 
572  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
573 
574  dmBitsPerPel = Current->dmBitsPerPel;
575  dmDisplayFrequency = Current->dmDisplayFrequency;
576 
577  if (CompareSettings(Current, dmNewPelsWidth,
578  dmNewPelsHeight, dmBitsPerPel,
579  dmDisplayFrequency) < 0)
580  {
581  Current = Current->Blink;
582  while (Current != NULL)
583  {
584  if (Current->dmPelsHeight == dmNewPelsHeight
585  && Current->dmPelsWidth == dmNewPelsWidth
586  && Current->dmBitsPerPel == dmBitsPerPel)
587  {
588  pData->CurrentDisplayDevice->CurrentSettings = Current;
589  UpdateDisplay(hwndDlg, pData, bUpdateThumb);
590  return;
591  }
592  Current = Current->Blink;
593  }
594  }
595  else
596  {
597  Current = Current->Flink;
598  while (Current != NULL)
599  {
600  if (Current->dmPelsHeight == dmNewPelsHeight
601  && Current->dmPelsWidth == dmNewPelsWidth
602  && Current->dmBitsPerPel == dmBitsPerPel)
603  {
604  pData->CurrentDisplayDevice->CurrentSettings = Current;
605  UpdateDisplay(hwndDlg, pData, bUpdateThumb);
606  return;
607  }
608  Current = Current->Flink;
609  }
610  }
611 
612  /* Search bigger color depth compatible with current resolution */
613  Current = pData->CurrentDisplayDevice->CurrentSettings->Flink;
614  while (Current != NULL)
615  {
616  if (dmNewPelsHeight == Current->dmPelsHeight && dmNewPelsWidth == Current->dmPelsWidth)
617  {
618  pData->CurrentDisplayDevice->CurrentSettings = Current;
619  UpdateDisplay(hwndDlg, pData, bUpdateThumb);
620  return;
621  }
622  Current = Current->Flink;
623  }
624 
625  /* Search smaller color depth compatible with current resolution */
626  Current = pData->CurrentDisplayDevice->CurrentSettings->Blink;
627  while (Current != NULL)
628  {
629  if (dmNewPelsHeight == Current->dmPelsHeight && dmNewPelsWidth == Current->dmPelsWidth)
630  {
631  pData->CurrentDisplayDevice->CurrentSettings = Current;
632  UpdateDisplay(hwndDlg, pData, bUpdateThumb);
633  return;
634  }
635  Current = Current->Blink;
636  }
637 
638  /* We shouldn't go there */
639 }
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:326
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:54
#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:5708
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define IDC_SETTINGS_RESOLUTION
Definition: resource.h:56
#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
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:319
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_SETTEXT
Definition: winuser.h:1599
#define IDC_SETTINGS_ADVANCED
Definition: resource.h:58
Definition: uimain.c:88
DWORD Flags
Definition: monslctl.h:19
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
Definition: wingdi.h:1378
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:60
#define IDC_SETTINGS_MONSEL
Definition: resource.h:59
#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:2790
#define IDB_SPECTRUM_4
Definition: resource.h:62
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:55
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:320
POINT Position
Definition: monslctl.h:17
#define HeapFree(x, y, z)
Definition: compat.h:394
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 643 of file settings.c.

644 {
645  UINT Ret = 0;
646 
647  switch (uMsg)
648  {
649  case PSPCB_CREATE:
651  break;
652 
653  case PSPCB_RELEASE:
655  break;
656  }
657 
658  return Ret;
659 }
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 808 of file settings.c.

809 {
811 
813 
814  switch(uMsg)
815  {
816  case WM_INITDIALOG:
817  {
818  SettingsOnInitDialog(hwndDlg);
819  break;
820  }
821  case WM_DRAWITEM:
822  {
823  LPDRAWITEMSTRUCT lpDrawItem;
824  lpDrawItem = (LPDRAWITEMSTRUCT) lParam;
825 
826  if (lpDrawItem->CtlID == IDC_SETTINGS_SPECTRUM)
827  ShowColorSpectrum(lpDrawItem->hDC, &lpDrawItem->rcItem, pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel, pData);
828  break;
829  }
830  case WM_COMMAND:
831  {
832  DWORD controlId = LOWORD(wParam);
834 
835  if (controlId == IDC_SETTINGS_ADVANCED && command == BN_CLICKED)
836  DisplayAdvancedSettings(hwndDlg, pData->CurrentDisplayDevice);
837  else if (controlId == IDC_SETTINGS_BPP && command == CBN_SELCHANGE)
838  OnBPPChanged(hwndDlg, pData);
839  break;
840  }
841  case WM_HSCROLL:
842  {
843  switch (LOWORD(wParam))
844  {
845  case TB_LINEUP:
846  case TB_LINEDOWN:
847  case TB_PAGEUP:
848  case TB_PAGEDOWN:
849  case TB_TOP:
850  case TB_BOTTOM:
851  case TB_ENDTRACK:
852  {
853  DWORD newPosition = (DWORD) SendDlgItemMessage(hwndDlg, IDC_SETTINGS_RESOLUTION, TBM_GETPOS, 0, 0);
854  OnResolutionChanged(hwndDlg, pData, newPosition, TRUE);
855  break;
856  }
857 
858  case TB_THUMBTRACK:
860  break;
861  }
862  break;
863  }
864  case WM_NOTIFY:
865  {
866  LPNMHDR lpnm = (LPNMHDR)lParam;
867  if (lpnm->code == (UINT)PSN_APPLY)
868  {
869  if (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  {
873  /* Apply new settings */
874  ApplyDisplaySettings(hwndDlg, pData);
875  }
876  }
877  break;
878  }
879 
880  case WM_CONTEXTMENU:
881  {
882  HWND hwndMonSel;
883  HMENU hPopup;
884  UINT uiCmd;
885  POINT pt, ptClient;
886  INT Index;
887 
888  pt.x = (SHORT)LOWORD(lParam);
889  pt.y = (SHORT)HIWORD(lParam);
890 
891  hwndMonSel = GetDlgItem(hwndDlg,
893  if ((HWND)wParam == hwndMonSel)
894  {
895  if (pt.x == -1 && pt.y == -1)
896  {
897  RECT rcMon;
898 
899  Index = (INT)SendMessage(hwndMonSel,
901  0,
902  0);
903 
904  if (Index >= 0 &&
905  (INT)SendMessage(hwndMonSel,
907  Index,
908  (LPARAM)&rcMon) > 0)
909  {
910  pt.x = rcMon.left + ((rcMon.right - rcMon.left) / 2);
911  pt.y = rcMon.top + ((rcMon.bottom - rcMon.top) / 2);
912  }
913  else
914  pt.x = pt.y = 0;
915 
916  MapWindowPoints(hwndMonSel,
917  NULL,
918  &pt,
919  1);
920  }
921  else
922  {
923  ptClient = pt;
925  hwndMonSel,
926  &ptClient,
927  1);
928 
929  Index = (INT)SendMessage(hwndMonSel,
930  MSLM_HITTEST,
931  (WPARAM)&ptClient,
932  0);
933  }
934 
935  if (Index >= 0)
936  {
937  hPopup = LoadPopupMenu(hApplet,
939  if (hPopup != NULL)
940  {
941  /* FIXME: Enable/Disable menu items */
942  EnableMenuItem(hPopup,
945  EnableMenuItem(hPopup,
948  EnableMenuItem(hPopup,
951  EnableMenuItem(hPopup,
954 
955  uiCmd = (UINT)TrackPopupMenu(hPopup,
957  pt.x,
958  pt.y,
959  0,
960  hwndDlg,
961  NULL);
962 
963  switch (uiCmd)
964  {
965  case ID_MENU_ATTACHED:
966  case ID_MENU_PRIMARY:
967  case ID_MENU_IDENTIFY:
968  case ID_MENU_PROPERTIES:
969  /* FIXME: Implement */
970  break;
971  }
972 
973  DestroyMenu(hPopup);
974  }
975  }
976  }
977  break;
978  }
979 
980  case WM_DESTROY:
981  {
982  DWORD i;
983  PDISPLAY_DEVICE_ENTRY Current = pData->DisplayDeviceList;
984 
985  while (Current != NULL)
986  {
987  PDISPLAY_DEVICE_ENTRY Next = Current->Flink;
988  PSETTINGS_ENTRY CurrentSettings = Current->Settings;
989  while (CurrentSettings != NULL)
990  {
991  PSETTINGS_ENTRY NextSettings = CurrentSettings->Flink;
992  HeapFree(GetProcessHeap(), 0, CurrentSettings);
993  CurrentSettings = NextSettings;
994  }
995  HeapFree(GetProcessHeap(), 0, Current);
996  Current = Next;
997  }
998 
999  for (i = 0; i < NUM_SPECTRUM_BITMAPS; i++)
1000  {
1001  if (pData->hSpectrumBitmaps[i])
1002  DeleteObject(pData->hSpectrumBitmaps[i]);
1003  }
1004 
1005  HeapFree(GetProcessHeap(), 0, pData);
1006  }
1007  }
1008  return FALSE;
1009 }
#define TB_THUMBTRACK
Definition: commctrl.h:2050
#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:551
#define MF_DISABLED
Definition: winuser.h:130
#define TRUE
Definition: types.h:120
#define TB_PAGEDOWN
Definition: commctrl.h:2048
#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 pt(x, y)
Definition: drawing.c:79
struct _DISPLAY_DEVICE_ENTRY * Flink
Definition: precomp.h:69
#define ID_MENU_PRIMARY
Definition: resource.h:73
BOOL DisplayAdvancedSettings(HWND hWndParent, PDISPLAY_DEVICE_ENTRY DisplayDevice)
Definition: advmon.c:81
#define TPM_RETURNCMD
Definition: winuser.h:2341
#define INT
Definition: polytest.cpp:20
LONG top
Definition: windef.h:292
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:5708
#define PSN_APPLY
Definition: prsht.h:117
LONG left
Definition: windef.h:291
#define IDC_SETTINGS_RESOLUTION
Definition: resource.h:56
LONG right
Definition: windef.h:293
#define ID_MENU_IDENTIFY
Definition: resource.h:74
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:56
WPARAM wParam
Definition: combotst.c:138
struct tagNMHDR * LPNMHDR
#define TB_PAGEUP
Definition: commctrl.h:2047
#define TB_LINEDOWN
Definition: commctrl.h:2046
UINT code
Definition: winuser.h:3112
#define MSLM_GETMONITORRECT
Definition: monslctl.h:212
#define TB_BOTTOM
Definition: commctrl.h:2052
#define TPM_RIGHTBUTTON
Definition: winuser.h:2334
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 TBM_GETPOS
Definition: commctrl.h:2003
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:58
#define WM_DESTROY
Definition: winuser.h:1591
#define GetProcessHeap()
Definition: compat.h:395
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
static const UCHAR Index[8]
Definition: usbohci.c:18
#define BN_CLICKED
Definition: winuser.h:1886
unsigned long DWORD
Definition: ntddk_ex.h:95
static VOID ApplyDisplaySettings(HWND hwndDlg, PSETTINGS_DATA pData)
Definition: settings.c:725
#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:2045
#define TB_ENDTRACK
Definition: commctrl.h:2053
#define TB_TOP
Definition: commctrl.h:2051
#define IDC_SETTINGS_SPECTRUM
Definition: resource.h:60
#define IDC_SETTINGS_MONSEL
Definition: resource.h:59
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1716
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define NUM_SPECTRUM_BITMAPS
Definition: desk.h:67
#define ID_MENU_PROPERTIES
Definition: resource.h:75
HMENU LoadPopupMenu(IN HINSTANCE hInstance, IN LPCWSTR lpMenuName)
Definition: util.cpp:33
#define IDM_MONITOR_MENU
Definition: resource.h:71
#define ID_MENU_ATTACHED
Definition: resource.h:72
unsigned int UINT
Definition: ndis.h:50
#define WM_HSCROLL
Definition: winuser.h:1719
#define CBN_SELCHANGE
Definition: winuser.h:1940
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:55
#define SendMessage
Definition: winuser.h:5709
#define MSLM_HITTEST
Definition: monslctl.h:120
struct _SETTINGS_DATA * PSETTINGS_DATA
#define HIWORD(l)
Definition: typedefs.h:246
LONG bottom
Definition: windef.h:294
#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:1715
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:394
#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:1497
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
int32_t INT
Definition: typedefs.h:56
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:2008
HINSTANCE hApplet
Definition: access.c:17
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5708
#define IDC_SETTINGS_RESOLUTION
Definition: resource.h:56
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:59
#define CB_SELECTSTRING
Definition: winuser.h:1921
#define _stprintf
Definition: utility.h:124
#define IDC_SETTINGS_BPP
Definition: resource.h:55
#define SendMessage
Definition: winuser.h:5709
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:5685

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