ReactOS  0.4.14-dev-57-g333b8f1
access.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <winuser.h>
#include <commctrl.h>
#include <tchar.h>
#include "resource.h"
Include dependency graph for access.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _APPLET
 
struct  _GLOBAL_DATA
 

Macros

#define WIN32_NO_STATUS
 

Typedefs

typedef LONG(CALLBACKAPPLET_INITPROC) (VOID)
 
typedef struct _APPLET APPLET
 
typedef struct _APPLETPAPPLET
 
typedef struct _GLOBAL_DATA GLOBAL_DATA
 
typedef struct _GLOBAL_DATAPGLOBAL_DATA
 

Functions

void ShowLastWin32Error (HWND hWndOwner)
 
INT_PTR CALLBACK DisplayPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK GeneralPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK KeyboardPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK MousePageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK SoundPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Variables

HINSTANCE hApplet
 

Macro Definition Documentation

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 6 of file access.h.

Typedef Documentation

◆ APPLET

◆ APPLET_INITPROC

typedef LONG(CALLBACK * APPLET_INITPROC) (VOID)

Definition at line 16 of file access.h.

◆ GLOBAL_DATA

◆ PAPPLET

typedef struct _APPLET * PAPPLET

◆ PGLOBAL_DATA

Function Documentation

◆ DisplayPageProc()

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

Definition at line 127 of file display.c.

131 {
132  PGLOBAL_DATA pGlobalData;
133  LPPSHNOTIFY lppsn;
134  INT i;
135 
136  pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
137 
138  switch (uMsg)
139  {
140  case WM_INITDIALOG:
141  pGlobalData = (PGLOBAL_DATA)((LPPROPSHEETPAGE)lParam)->lParam;
142  if (pGlobalData == NULL)
143  return FALSE;
144 
145  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
146 
147  pGlobalData->fShowCaret = TRUE;
148  GetWindowRect(GetDlgItem(hwndDlg, IDC_CURSOR_WIDTH_TEXT), &pGlobalData->rcCaret);
149  ScreenToClient(hwndDlg, (LPPOINT)&pGlobalData->rcCaret.left);
150  ScreenToClient(hwndDlg, (LPPOINT)&pGlobalData->rcCaret.right);
151  CopyRect(&pGlobalData->rcOldCaret, &pGlobalData->rcCaret);
152 
153  pGlobalData->rcCaret.right = pGlobalData->rcCaret.left + pGlobalData->uCaretWidth;
154 
155  /* Set the checkbox */
156  CheckDlgButton(hwndDlg,
159 
161  SendDlgItemMessage(hwndDlg, IDC_CURSOR_BLINK_TRACK, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)(12 - (pGlobalData->uCaretBlinkTime / 100)));
162 
165 
166  /* Start the blink timer */
167  SetTimer(hwndDlg, ID_BLINK_TIMER, pGlobalData->uCaretBlinkTime, NULL);
168  return TRUE;
169 
170  case WM_COMMAND:
171  switch (LOWORD(wParam))
172  {
173  case IDC_CONTRAST_BOX:
174  pGlobalData->highContrast.dwFlags ^= HCF_HIGHCONTRASTON;
175  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
176  break;
177 
178  case IDC_CONTRAST_BUTTON:
181  hwndDlg,
183  (LPARAM)pGlobalData))
184  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
185  break;
186 
187  default:
188  break;
189  }
190  break;
191 
192  case WM_HSCROLL:
193  switch (GetWindowLongPtr((HWND) lParam, GWL_ID))
194  {
197  pGlobalData->uCaretBlinkTime = (12 - (UINT)i) * 100;
198  KillTimer(hwndDlg, ID_BLINK_TIMER);
199  SetTimer(hwndDlg, ID_BLINK_TIMER, pGlobalData->uCaretBlinkTime, NULL);
200  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
201  break;
202 
205  pGlobalData->uCaretWidth = (UINT)i + 1;
206  pGlobalData->rcCaret.right = pGlobalData->rcCaret.left + pGlobalData->uCaretWidth;
207  if (pGlobalData->fShowCaret)
208  {
209  HDC hDC = GetDC(hwndDlg);
210  HBRUSH hBrush = GetSysColorBrush(COLOR_BTNTEXT);
211  FillRect(hDC, &pGlobalData->rcCaret, hBrush);
212  DeleteObject(hBrush);
213  ReleaseDC(hwndDlg, hDC);
214  }
215  else
216  {
217  InvalidateRect(hwndDlg, &pGlobalData->rcOldCaret, TRUE);
218  }
219  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
220  break;
221  }
222  break;
223 
224  case WM_TIMER:
225  if (wParam == ID_BLINK_TIMER)
226  {
227  if (pGlobalData->fShowCaret)
228  {
229  HDC hDC = GetDC(hwndDlg);
230  HBRUSH hBrush = GetSysColorBrush(COLOR_BTNTEXT);
231  FillRect(hDC, &pGlobalData->rcCaret, hBrush);
232  DeleteObject(hBrush);
233  ReleaseDC(hwndDlg, hDC);
234  }
235  else
236  {
237  InvalidateRect(hwndDlg, &pGlobalData->rcOldCaret, TRUE);
238  }
239 
240  pGlobalData->fShowCaret = !pGlobalData->fShowCaret;
241  }
242  break;
243 
244  case WM_NOTIFY:
245  lppsn = (LPPSHNOTIFY)lParam;
246  if (lppsn->hdr.code == PSN_APPLY)
247  {
248  SetCaretBlinkTime(pGlobalData->uCaretBlinkTime);
249  SystemParametersInfo(SPI_SETCARETWIDTH,
250  0,
251  IntToPtr(pGlobalData->uCaretWidth),
253  SystemParametersInfo(SPI_SETHIGHCONTRAST,
254  sizeof(HIGHCONTRAST),
255  &pGlobalData->highContrast,
257  return TRUE;
258  }
259  break;
260 
261  case WM_DESTROY:
262  KillTimer(hwndDlg, ID_BLINK_TIMER);
263  break;
264  }
265 
266  return FALSE;
267 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define TRUE
Definition: types.h:120
struct _PSHNOTIFY * LPPSHNOTIFY
HDC WINAPI GetDC(_In_opt_ HWND)
#define GWL_ID
Definition: winuser.h:853
static HDC
Definition: imagelist.c:92
#define TBM_SETRANGE
Definition: commctrl.h:2009
#define SystemParametersInfo
Definition: winuser.h:5759
#define IDC_CONTRAST_BUTTON
Definition: resource.h:48
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#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:5743
#define PSN_APPLY
Definition: prsht.h:117
LONG left
Definition: windef.h:291
#define IDC_CONTRAST_BOX
Definition: resource.h:47
RECT rcCaret
Definition: access.h:47
LONG right
Definition: windef.h:293
int32_t INT
Definition: typedefs.h:56
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
UINT code
Definition: winuser.h:3133
#define HCF_HIGHCONTRASTON
Definition: winuser.h:2116
NMHDR hdr
Definition: prsht.h:312
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 TBM_GETPOS
Definition: commctrl.h:2003
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define MAKELONG(a, b)
Definition: typedefs.h:248
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_DESTROY
Definition: winuser.h:1591
#define IntToPtr(i)
Definition: basetsd.h:89
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define WM_TIMER
Definition: winuser.h:1724
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define DialogBoxParam
Definition: winuser.h:5665
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define IDC_CURSOR_BLINK_TRACK
Definition: resource.h:89
BOOL fShowCaret
Definition: access.h:46
#define DWLP_USER
Definition: winuser.h:866
INT_PTR CALLBACK HighContrastDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: display.c:59
#define WM_COMMAND
Definition: winuser.h:1722
#define BST_UNCHECKED
Definition: winuser.h:199
RECT rcOldCaret
Definition: access.h:48
#define IDD_CONTRASTOPTIONS
Definition: resource.h:18
static HDC hDC
Definition: 3dtext.c:33
#define IDC_CURSOR_WIDTH_TRACK
Definition: resource.h:90
HWND WINAPI GetParent(_In_ HWND)
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
UINT uCaretBlinkTime
Definition: access.h:44
HIGHCONTRAST highContrast
Definition: access.h:43
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define WM_HSCROLL
Definition: winuser.h:1725
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
BOOL WINAPI SetCaretBlinkTime(_In_ UINT)
#define ID_BLINK_TIMER
Definition: display.c:14
#define BST_CHECKED
Definition: winuser.h:197
struct _GLOBAL_DATA * PGLOBAL_DATA
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define COLOR_BTNTEXT
Definition: winuser.h:923
#define GetWindowLongPtr
Definition: treelist.c:73
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
UINT uCaretWidth
Definition: access.h:45
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
#define IDC_CURSOR_WIDTH_TEXT
Definition: resource.h:91
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by SystemApplet().

◆ GeneralPageProc()

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

Definition at line 327 of file propsheet_general.c.

331 {
332  PPAGEDATA pPageData;
333 
334  /* Get the window context */
335  pPageData = (PPAGEDATA)GetWindowLongPtr(hwndDlg,
336  GWLP_USERDATA);
337  if (pPageData == NULL && uMsg != WM_INITDIALOG)
338  {
339  return FALSE;
340  }
341 
342  switch (uMsg)
343  {
344  case WM_INITDIALOG:
345  pPageData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PAGEDATA));
346  if (pPageData != NULL)
347  {
348  SetWindowLongPtr(hwndDlg,
350  (LONG_PTR)pPageData);
351 
352  pPageData->dlgInfo = (PSERVICEPROPSHEET)(((LPPROPSHEETPAGE)lParam)->lParam);
353  if (pPageData->dlgInfo != NULL)
354  {
355  InitGeneralPage(pPageData->dlgInfo, hwndDlg);
356  SetButtonStates(pPageData->dlgInfo, hwndDlg);
357  }
358  }
359  break;
360 
361  case WM_DESTROY:
362  HeapFree(GetProcessHeap(), 0, pPageData);
363  break;
364 
365  case WM_COMMAND:
366  switch(LOWORD(wParam))
367  {
368  case IDC_START_TYPE:
369  if (HIWORD(wParam) == CBN_SELCHANGE)
370  {
371  pPageData->bStartTypeChanged = TRUE;
372  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
373  }
374  break;
375 
376  case IDC_DISP_NAME:
377  if (HIWORD(wParam) == EN_CHANGE)
378  {
379  pPageData->bDisplayNameChanged = TRUE;
380  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
381  }
382  break;
383 
384  case IDC_DESCRIPTION:
385  if (HIWORD(wParam) == EN_CHANGE)
386  {
387  pPageData->bDescriptionChanged = TRUE;
388  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
389  }
390  break;
391 
392  case IDC_EXEPATH:
393  if (HIWORD(wParam) == EN_CHANGE)
394  {
395  pPageData->bBinaryPathChanged = TRUE;
396  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
397  }
398  break;
399 
400  case IDC_START:
401  {
402  WCHAR szStartParams[256];
403  LPWSTR lpStartParams = NULL;
404 
405  if (GetDlgItemText(hwndDlg, IDC_START_PARAM, szStartParams, 256) > 0)
406  lpStartParams = szStartParams;
407 
409 
410  RunActionWithProgress(hwndDlg,
411  pPageData->dlgInfo->pService->lpServiceName,
412  pPageData->dlgInfo->pService->lpDisplayName,
413  ACTION_START,
414  lpStartParams);
415 
416  UpdateServiceStatus(pPageData->dlgInfo->pService);
417  ChangeListViewText(pPageData->dlgInfo->Info, pPageData->dlgInfo->pService, LVSTATUS);
418  SetButtonStates(pPageData->dlgInfo, hwndDlg);
419  SetServiceStatusText(pPageData->dlgInfo, hwndDlg);
420  break;
421  }
422 
423  case IDC_STOP:
424  RunActionWithProgress(hwndDlg,
425  pPageData->dlgInfo->pService->lpServiceName,
426  pPageData->dlgInfo->pService->lpDisplayName,
427  ACTION_STOP,
428  NULL);
429 
430  UpdateServiceStatus(pPageData->dlgInfo->pService);
431  ChangeListViewText(pPageData->dlgInfo->Info, pPageData->dlgInfo->pService, LVSTATUS);
432  SetButtonStates(pPageData->dlgInfo, hwndDlg);
433  SetServiceStatusText(pPageData->dlgInfo, hwndDlg);
434  break;
435 
436  case IDC_PAUSE:
437  RunActionWithProgress(hwndDlg,
438  pPageData->dlgInfo->pService->lpServiceName,
439  pPageData->dlgInfo->pService->lpDisplayName,
440  ACTION_PAUSE,
441  NULL);
442 
443  UpdateServiceStatus(pPageData->dlgInfo->pService);
444  ChangeListViewText(pPageData->dlgInfo->Info, pPageData->dlgInfo->pService, LVSTATUS);
445  SetButtonStates(pPageData->dlgInfo, hwndDlg);
446  SetServiceStatusText(pPageData->dlgInfo, hwndDlg);
447  break;
448 
449  case IDC_RESUME:
450  RunActionWithProgress(hwndDlg,
451  pPageData->dlgInfo->pService->lpServiceName,
452  pPageData->dlgInfo->pService->lpDisplayName,
454  NULL);
455 
456  UpdateServiceStatus(pPageData->dlgInfo->pService);
457  ChangeListViewText(pPageData->dlgInfo->Info, pPageData->dlgInfo->pService, LVSTATUS);
458  SetButtonStates(pPageData->dlgInfo, hwndDlg);
459  SetServiceStatusText(pPageData->dlgInfo, hwndDlg);
460  break;
461 
462  case IDC_EDIT:
467  break;
468  }
469  break;
470 
471  case WM_NOTIFY:
472  switch (((LPNMHDR)lParam)->code)
473  {
474  case PSN_APPLY:
475  if (pPageData->bDisplayNameChanged ||
476  pPageData->bDescriptionChanged ||
477  pPageData->bBinaryPathChanged ||
478  pPageData->bStartTypeChanged)
479  {
480  SaveDlgInfo(pPageData, hwndDlg);
481  SetButtonStates(pPageData->dlgInfo, hwndDlg);
482  pPageData->bDisplayNameChanged = FALSE;
483  pPageData->bDescriptionChanged = FALSE;
484  pPageData->bBinaryPathChanged = FALSE;
485  pPageData->bStartTypeChanged = FALSE;
486  }
487  break;
488  }
489  break;
490  }
491 
492  return FALSE;
493 }
#define IDC_START_TYPE
Definition: resource.h:133
struct _PAGEDATA * PPAGEDATA
#define TRUE
Definition: types.h:120
#define ACTION_START
Definition: precomp.h:37
#define EM_SETREADONLY
Definition: winuser.h:1997
static VOID SetServiceStatusText(PSERVICEPROPSHEET dlgInfo, HWND hwndDlg)
#define ACTION_STOP
Definition: precomp.h:38
BOOL bDescriptionChanged
BOOL RunActionWithProgress(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT Action, PVOID Param)
Definition: progress.c:322
PSERVICEPROPSHEET dlgInfo
#define SendDlgItemMessage
Definition: winuser.h:5743
#define PSN_APPLY
Definition: prsht.h:117
BOOL bDisplayNameChanged
#define IDC_PAUSE
Definition: resource.h:75
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define IDC_START
Definition: resource.h:137
#define LVSTATUS
Definition: precomp.h:29
#define IDC_STOP
Definition: resource.h:69
#define GWLP_USERDATA
Definition: treelist.c:63
BOOL bBinaryPathChanged
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
#define ACTION_RESUME
Definition: precomp.h:40
#define WM_DESTROY
Definition: winuser.h:1591
#define GetDlgItemText
Definition: winuser.h:5686
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define IDC_DISP_NAME
Definition: resource.h:130
#define IDC_DESCRIPTION
Definition: resource.h:131
static VOID SetButtonStates(PSERVICEPROPSHEET dlgInfo, HWND hwndDlg)
BOOL bStartTypeChanged
#define WM_COMMAND
Definition: winuser.h:1722
#define IDC_START_PARAM
Definition: resource.h:135
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define ACTION_PAUSE
Definition: precomp.h:39
HWND WINAPI GetParent(_In_ HWND)
VOID ChangeListViewText(PMAIN_WND_INFO Info, ENUM_SERVICE_STATUS_PROCESS *pService, UINT Column)
Definition: listview.c:105
BOOL UpdateServiceStatus(ENUM_SERVICE_STATUS_PROCESS *pService)
Definition: query.c:373
ENUM_SERVICE_STATUS_PROCESS * pService
Definition: precomp.h:130
#define IDC_RESUME
Definition: resource.h:140
#define IDC_EDIT
Definition: resource.h:136
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define CBN_SELCHANGE
Definition: winuser.h:1961
#define HIWORD(l)
Definition: typedefs.h:246
#define IDC_EXEPATH
Definition: resource.h:132
#define GetWindowLongPtr
Definition: treelist.c:73
WCHAR * LPWSTR
Definition: xmlstorage.h:184
struct _SERVICEPROPSHEET * PSERVICEPROPSHEET
#define WM_INITDIALOG
Definition: winuser.h:1721
static VOID InitGeneralPage(PSERVICEPROPSHEET dlgInfo, HWND hwndDlg)
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
PMAIN_WND_INFO Info
Definition: precomp.h:129
#define HeapFree(x, y, z)
Definition: compat.h:394
VOID SaveDlgInfo(PPAGEDATA pPageData, HWND hwndDlg)
#define WM_NOTIFY
Definition: richedit.h:61
#define EN_CHANGE
Definition: winuser.h:2004

◆ KeyboardPageProc()

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

Definition at line 576 of file keyboard.c.

580 {
581  PGLOBAL_DATA pGlobalData;
582  LPPSHNOTIFY lppsn;
583 
584  pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
585 
586  switch (uMsg)
587  {
588  case WM_INITDIALOG:
589  pGlobalData = (PGLOBAL_DATA)((LPPROPSHEETPAGE)lParam)->lParam;
590  if (pGlobalData == NULL)
591  return FALSE;
592 
593  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
594 
595  CheckDlgButton(hwndDlg,
598 
599  CheckDlgButton(hwndDlg,
602 
603  CheckDlgButton(hwndDlg,
606 
607  CheckDlgButton(hwndDlg,
609  pGlobalData->bKeyboardPref ? BST_CHECKED : BST_UNCHECKED);
610  return TRUE;
611 
612  case WM_COMMAND:
613  switch (LOWORD(wParam))
614  {
615  case IDC_STICKY_BOX:
616  pGlobalData->stickyKeys.dwFlags ^= SKF_STICKYKEYSON;
617  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
618  break;
619 
620  case IDC_STICKY_BUTTON:
623  hwndDlg,
625  (LPARAM)pGlobalData))
626  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
627  break;
628 
629  case IDC_FILTER_BOX:
630  pGlobalData->filterKeys.dwFlags ^= FKF_FILTERKEYSON;
631  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
632  break;
633 
634  case IDC_FILTER_BUTTON:
637  hwndDlg,
639  (LPARAM)pGlobalData))
640  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
641  break;
642 
643  case IDC_TOGGLE_BOX:
644  pGlobalData->toggleKeys.dwFlags ^= TKF_TOGGLEKEYSON;
645  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
646  break;
647 
648  case IDC_TOGGLE_BUTTON:
651  hwndDlg,
653  (LPARAM)pGlobalData))
654  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
655  break;
656 
657  case IDC_KEYBOARD_EXTRA:
658  pGlobalData->bKeyboardPref = !pGlobalData->bKeyboardPref;
659  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
660  break;
661 
662  default:
663  break;
664  }
665  break;
666 
667  case WM_NOTIFY:
668  lppsn = (LPPSHNOTIFY)lParam;
669  if (lppsn->hdr.code == PSN_APPLY)
670  {
672  sizeof(STICKYKEYS),
673  &pGlobalData->stickyKeys,
675 
677  sizeof(FILTERKEYS),
678  &pGlobalData->filterKeys,
680 
682  sizeof(TOGGLEKEYS),
683  &pGlobalData->toggleKeys,
685 
686  SystemParametersInfo(SPI_SETKEYBOARDPREF,
687  pGlobalData->bKeyboardPref,
688  NULL,
690 
691  return TRUE;
692  }
693  break;
694  }
695 
696  return FALSE;
697 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define TRUE
Definition: types.h:120
TOGGLEKEYS toggleKeys
Definition: access.h:34
INT_PTR CALLBACK FilterKeysDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: keyboard.c:404
DWORD dwFlags
Definition: winuser.h:3330
#define SPI_SETTOGGLEKEYS
Definition: winuser.h:1384
struct _PSHNOTIFY * LPPSHNOTIFY
#define IDC_STICKY_BOX
Definition: resource.h:34
#define SystemParametersInfo
Definition: winuser.h:5759
#define SPI_SETFILTERKEYS
Definition: winuser.h:1382
HINSTANCE hApplet
Definition: access.c:17
#define PSN_APPLY
Definition: prsht.h:117
FILTERKEYS filterKeys
Definition: access.h:32
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define IDD_TOGGLEKEYSOPTIONS
Definition: resource.h:16
UINT code
Definition: winuser.h:3133
#define IDD_STICKYKEYSOPTIONS
Definition: resource.h:12
NMHDR hdr
Definition: prsht.h:312
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define TKF_TOGGLEKEYSON
Definition: winuser.h:2161
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
STICKYKEYS stickyKeys
Definition: access.h:30
#define DialogBoxParam
Definition: winuser.h:5665
DWORD dwFlags
Definition: winuser.h:3509
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1722
#define BST_UNCHECKED
Definition: winuser.h:199
#define IDC_STICKY_BUTTON
Definition: resource.h:35
HWND WINAPI GetParent(_In_ HWND)
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
INT_PTR CALLBACK ToggleKeysDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: keyboard.c:524
BOOL bKeyboardPref
Definition: access.h:36
#define IDC_TOGGLE_BUTTON
Definition: resource.h:39
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
#define SKF_STICKYKEYSON
Definition: winuser.h:2154
#define SPI_SETSTICKYKEYS
Definition: winuser.h:1390
#define BST_CHECKED
Definition: winuser.h:197
struct _GLOBAL_DATA * PGLOBAL_DATA
DWORD dwFlags
Definition: winuser.h:3504
#define IDD_FILTERKEYSOPTIONS
Definition: resource.h:13
#define IDC_FILTER_BUTTON
Definition: resource.h:37
INT_PTR CALLBACK StickyKeysDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: keyboard.c:68
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61
#define IDC_TOGGLE_BOX
Definition: resource.h:38
#define IDC_KEYBOARD_EXTRA
Definition: resource.h:40
#define IDC_FILTER_BOX
Definition: resource.h:36
#define FKF_FILTERKEYSON
Definition: winuser.h:2111

Referenced by SystemApplet().

◆ MousePageProc()

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

Definition at line 142 of file mouse.c.

146 {
147  PGLOBAL_DATA pGlobalData;
148  LPPSHNOTIFY lppsn;
149 
150  pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
151 
152  switch (uMsg)
153  {
154  case WM_INITDIALOG:
155  pGlobalData = (PGLOBAL_DATA)((LPPROPSHEETPAGE)lParam)->lParam;
156  if (pGlobalData == NULL)
157  return FALSE;
158 
159  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
160 
161  /* Set the checkbox */
162  CheckDlgButton(hwndDlg,
165  return TRUE;
166 
167 
168  case WM_COMMAND:
169  switch (LOWORD(wParam))
170  {
171  case IDC_MOUSE_BOX:
172  pGlobalData->mouseKeys.dwFlags ^= MKF_MOUSEKEYSON;
173  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
174  break;
175 
176  case IDC_MOUSE_BUTTON:
179  hwndDlg,
181  (LPARAM)pGlobalData))
182  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
183  break;
184 
185  default:
186  break;
187  }
188  break;
189 
190  case WM_NOTIFY:
191  lppsn = (LPPSHNOTIFY)lParam;
192  if (lppsn->hdr.code == PSN_APPLY)
193  {
195  sizeof(MOUSEKEYS),
196  &pGlobalData->mouseKeys,
198  return TRUE;
199  }
200  break;
201  }
202 
203  return FALSE;
204 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define TRUE
Definition: types.h:120
#define SPI_SETMOUSEKEYS
Definition: winuser.h:1386
struct _PSHNOTIFY * LPPSHNOTIFY
#define IDC_MOUSE_BOX
Definition: resource.h:49
#define SystemParametersInfo
Definition: winuser.h:5759
DWORD dwFlags
Definition: winuser.h:3386
HINSTANCE hApplet
Definition: access.c:17
#define PSN_APPLY
Definition: prsht.h:117
#define IDC_MOUSE_BUTTON
Definition: resource.h:50
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define IDD_MOUSEKEYSOPTIONS
Definition: resource.h:19
UINT code
Definition: winuser.h:3133
NMHDR hdr
Definition: prsht.h:312
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define DialogBoxParam
Definition: winuser.h:5665
MOUSEKEYS mouseKeys
Definition: access.h:51
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1722
#define BST_UNCHECKED
Definition: winuser.h:199
HWND WINAPI GetParent(_In_ HWND)
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
INT_PTR CALLBACK MouseKeysDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: mouse.c:19
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
#define BST_CHECKED
Definition: winuser.h:197
struct _GLOBAL_DATA * PGLOBAL_DATA
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61
#define MKF_MOUSEKEYSON
Definition: winuser.h:2128

Referenced by SystemApplet().

◆ ShowLastWin32Error()

void ShowLastWin32Error ( HWND  hWndOwner)

Definition at line 11 of file winutils.c.

12 {
13  DWORD dwError;
14  LPWSTR lpMsgBuf = NULL;
15 
16  dwError = GetLastError();
17  if (dwError == ERROR_SUCCESS)
18  return;
19 
23  NULL,
24  dwError,
26  (LPWSTR)&lpMsgBuf,
27  0, NULL))
28  {
29  return;
30  }
31 
33  LocalFree(lpMsgBuf);
34 }
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MB_ICONERROR
Definition: winuser.h:781
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:401
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define MB_OK
Definition: winuser.h:784
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50

◆ SoundPageProc()

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

Definition at line 56 of file sound.c.

60 {
61  PGLOBAL_DATA pGlobalData;
62 
63  pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
64 
65  switch (uMsg)
66  {
67  case WM_INITDIALOG:
68  pGlobalData = (PGLOBAL_DATA)((LPPROPSHEETPAGE)lParam)->lParam;
69 
70  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
71 
72  OnInitDialog(hwndDlg, pGlobalData);
73  break;
74 
75  case WM_COMMAND:
76  switch (LOWORD(wParam))
77  {
78  case IDC_SENTRY_BOX:
79  pGlobalData->ssSoundSentry.dwFlags ^= SSF_SOUNDSENTRYON;
82  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
83  break;
84 
85  case IDC_SENTRY_COMBO:
86  if (HIWORD(wParam) == CBN_SELENDOK)
87  {
88  pGlobalData->ssSoundSentry.iWindowsEffect =
90  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
91  }
92  break;
93 
94  case IDC_SSHOW_BOX:
95  pGlobalData->bShowSounds = !pGlobalData->bShowSounds;
96  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
97  break;
98 
99  default:
100  break;
101  }
102  break;
103 
104  case WM_NOTIFY:
105  switch (((LPNMHDR)lParam)->code)
106  {
107  case PSN_APPLY:
109  sizeof(SOUNDSENTRY),
110  &pGlobalData->ssSoundSentry,
113  pGlobalData->bShowSounds,
114  0,
116  return TRUE;
117 
118  default:
119  break;
120  }
121  break;
122  }
123 
124  return FALSE;
125 }
#define TRUE
Definition: types.h:120
BOOL bShowSounds
Definition: access.h:40
#define SystemParametersInfo
Definition: winuser.h:5759
DWORD iWindowsEffect
Definition: winuser.h:3473
#define IDC_SSHOW_BOX
Definition: resource.h:45
#define PSN_APPLY
Definition: prsht.h:117
#define DWORD
Definition: nt_native.h:44
#define SetWindowLongPtr
Definition: treelist.c:70
#define CB_GETCURSEL
Definition: winuser.h:1925
WPARAM wParam
Definition: combotst.c:138
#define CBN_SELENDOK
Definition: winuser.h:1963
#define LPPROPSHEETPAGE
Definition: prsht.h:372
SOUNDSENTRY ssSoundSentry
Definition: access.h:39
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
static VOID OnInitDialog(HWND hwndDlg, PGLOBAL_DATA pGlobalData)
Definition: sound.c:13
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define IDC_SENTRY_BOX
Definition: resource.h:42
#define SPI_SETSOUNDSENTRY
Definition: winuser.h:1398
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1722
#define SSF_SOUNDSENTRYON
Definition: winuser.h:2136
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
#define IDC_SENTRY_TEXT
Definition: resource.h:43
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
struct _GLOBAL_DATA * PGLOBAL_DATA
#define SendMessage
Definition: winuser.h:5744
#define HIWORD(l)
Definition: typedefs.h:246
#define IDC_SENTRY_COMBO
Definition: resource.h:44
#define GetWindowLongPtr
Definition: treelist.c:73
#define SPI_SETSHOWSOUNDS
Definition: winuser.h:1388
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by SystemApplet().

Variable Documentation

◆ hApplet

HINSTANCE hApplet

Definition at line 17 of file access.c.