ReactOS 0.4.15-dev-5667-ged97270
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 <cpl.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 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

◆ 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 152 of file display.c.

156{
157 PGLOBAL_DATA pGlobalData;
158 LPPSHNOTIFY lppsn;
159 INT i;
160
161 pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
162
163 switch (uMsg)
164 {
165 case WM_INITDIALOG:
166 pGlobalData = (PGLOBAL_DATA)((LPPROPSHEETPAGE)lParam)->lParam;
167 if (pGlobalData == NULL)
168 return FALSE;
169
170 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
171
172 pGlobalData->fShowCaret = TRUE;
173 GetWindowRect(GetDlgItem(hwndDlg, IDC_CURSOR_WIDTH_TEXT), &pGlobalData->rcCaret);
174 ScreenToClient(hwndDlg, (LPPOINT)&pGlobalData->rcCaret.left);
175 ScreenToClient(hwndDlg, (LPPOINT)&pGlobalData->rcCaret.right);
176 CopyRect(&pGlobalData->rcOldCaret, &pGlobalData->rcCaret);
177
178 pGlobalData->rcCaret.right = pGlobalData->rcCaret.left + pGlobalData->uCaretWidth;
179
180 /* Set the checkbox */
181 CheckDlgButton(hwndDlg,
184
186 SendDlgItemMessage(hwndDlg, IDC_CURSOR_BLINK_TRACK, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)(12 - (pGlobalData->uCaretBlinkTime / 100)));
187
190
191 /* Start the blink timer */
192 pGlobalData->uCaretBlinkTime = pGlobalData->uCaretBlinkTime >= 1200 ? -1 : pGlobalData->uCaretBlinkTime;
193 if ((INT)pGlobalData->uCaretBlinkTime > 0)
194 {
195 SetTimer(hwndDlg, ID_BLINK_TIMER, pGlobalData->uCaretBlinkTime, NULL);
196 }
197 else
198 {
199 PostMessage(hwndDlg, WM_TIMER, ID_BLINK_TIMER, 0);
200 }
201
202 return TRUE;
203
204 case WM_COMMAND:
205 switch (LOWORD(wParam))
206 {
207 case IDC_CONTRAST_BOX:
209 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
210 break;
211
215 hwndDlg,
217 (LPARAM)pGlobalData))
218 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
219 break;
220
221 default:
222 break;
223 }
224 break;
225
226 case WM_HSCROLL:
228 {
231 pGlobalData->uCaretBlinkTime = (12 - (UINT)i) * 100;
232 KillTimer(hwndDlg, ID_BLINK_TIMER);
233 pGlobalData->uCaretBlinkTime = pGlobalData->uCaretBlinkTime >= 1200 ? -1 : pGlobalData->uCaretBlinkTime;
234 if ((INT)pGlobalData->uCaretBlinkTime > 0)
235 {
236 SetTimer(hwndDlg, ID_BLINK_TIMER, pGlobalData->uCaretBlinkTime, NULL);
237 }
238 else if (pGlobalData->fShowCaret)
239 {
240 SendMessage(hwndDlg, WM_TIMER, ID_BLINK_TIMER, 0);
241 }
242 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
243 break;
244
247 pGlobalData->uCaretWidth = (UINT)i + 1;
248 pGlobalData->rcCaret.right = pGlobalData->rcCaret.left + pGlobalData->uCaretWidth;
249 if (pGlobalData->fShowCaret)
250 {
251 HDC hDC = GetDC(hwndDlg);
252 HBRUSH hBrush = GetSysColorBrush(COLOR_BTNTEXT);
253 FillRect(hDC, &pGlobalData->rcCaret, hBrush);
254 ReleaseDC(hwndDlg, hDC);
255 }
256 else
257 {
258 InvalidateRect(hwndDlg, &pGlobalData->rcOldCaret, TRUE);
259 }
260 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
261 break;
262 }
263 break;
264
265 case WM_TIMER:
266 if (wParam == ID_BLINK_TIMER)
267 {
268 if (pGlobalData->fShowCaret)
269 {
270 HDC hDC = GetDC(hwndDlg);
271 HBRUSH hBrush = GetSysColorBrush(COLOR_BTNTEXT);
272 FillRect(hDC, &pGlobalData->rcCaret, hBrush);
273 ReleaseDC(hwndDlg, hDC);
274 }
275 else
276 {
277 InvalidateRect(hwndDlg, &pGlobalData->rcOldCaret, TRUE);
278 }
279
280 pGlobalData->fShowCaret = !pGlobalData->fShowCaret;
281 }
282 break;
283
284 case WM_NOTIFY:
285 lppsn = (LPPSHNOTIFY)lParam;
286 if (lppsn->hdr.code == PSN_APPLY)
287 {
288 if (SetCaretBlinkTime(pGlobalData->uCaretBlinkTime))
289 {
290 UpdateCaretBlinkTimeReg(pGlobalData->uCaretBlinkTime);
291 }
292
293 SystemParametersInfo(SPI_SETCARETWIDTH,
294 0,
295 IntToPtr(pGlobalData->uCaretWidth),
297 SystemParametersInfo(SPI_SETHIGHCONTRAST,
298 sizeof(HIGHCONTRAST),
299 &pGlobalData->highContrast,
301 return TRUE;
302 }
303 break;
304
305 case WM_DESTROY:
306 KillTimer(hwndDlg, ID_BLINK_TIMER);
307 break;
308 }
309
310 return FALSE;
311}
static HDC hDC
Definition: 3dtext.c:33
struct _GLOBAL_DATA * PGLOBAL_DATA
#define IntToPtr(i)
Definition: basetsd.h:89
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HINSTANCE hApplet
Definition: access.c:17
#define ID_BLINK_TIMER
Definition: display.c:14
INT_PTR CALLBACK HighContrastDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: display.c:84
static VOID UpdateCaretBlinkTimeReg(_In_ UINT uCaretBlinkTime)
Definition: display.c:17
#define IDD_CONTRASTOPTIONS
Definition: resource.h:18
#define IDC_CURSOR_WIDTH_TRACK
Definition: resource.h:90
#define IDC_CURSOR_BLINK_TRACK
Definition: resource.h:89
#define IDC_CONTRAST_BOX
Definition: resource.h:47
#define IDC_CONTRAST_BUTTON
Definition: resource.h:48
#define IDC_CURSOR_WIDTH_TEXT
Definition: resource.h:91
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
static HDC
Definition: imagelist.c:92
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_APPLY
Definition: prsht.h:117
#define LPPROPSHEETPAGE
Definition: prsht.h:390
struct _PSHNOTIFY * LPPSHNOTIFY
#define TBM_GETPOS
Definition: commctrl.h:2031
#define TBM_SETRANGE
Definition: commctrl.h:2037
#define TBM_SETPOS
Definition: commctrl.h:2036
#define WM_NOTIFY
Definition: richedit.h:61
BOOL fShowCaret
Definition: access.h:45
UINT uCaretWidth
Definition: access.h:44
UINT uCaretBlinkTime
Definition: access.h:43
RECT rcCaret
Definition: access.h:46
HIGHCONTRAST highContrast
Definition: access.h:42
RECT rcOldCaret
Definition: access.h:47
NMHDR hdr
Definition: prsht.h:330
UINT code
Definition: winuser.h:3149
LONG right
Definition: windef.h:308
LONG left
Definition: windef.h:306
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT
Definition: typedefs.h:58
#define MAKELONG(a, b)
Definition: typedefs.h:249
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
#define HCF_HIGHCONTRASTON
Definition: winuser.h:2124
#define COLOR_BTNTEXT
Definition: winuser.h:927
#define DWLP_USER
Definition: winuser.h:866
#define WM_HSCROLL
Definition: winuser.h:1733
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define GWL_ID
Definition: winuser.h:853
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define WM_COMMAND
Definition: winuser.h:1730
BOOL WINAPI SetCaretBlinkTime(_In_ UINT)
#define DialogBoxParam
Definition: winuser.h:5754
#define WM_INITDIALOG
Definition: winuser.h:1729
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define SPIF_SENDCHANGE
Definition: winuser.h:1562
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1561
#define WM_TIMER
Definition: winuser.h:1732
#define SendMessage
Definition: winuser.h:5833
HDC WINAPI GetDC(_In_opt_ HWND)
#define PostMessage
Definition: winuser.h:5822
HWND WINAPI GetParent(_In_ HWND)
#define WM_DESTROY
Definition: winuser.h:1599
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SystemParametersInfo
Definition: winuser.h:5848
#define SendDlgItemMessage
Definition: winuser.h:5832
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define BST_CHECKED
Definition: winuser.h:197
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

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,
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:
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,
414 lpStartParams);
415
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,
428 NULL);
429
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,
441 NULL);
442
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
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_PAUSE
Definition: resource.h:75
#define IDC_STOP
Definition: resource.h:69
VOID ChangeListViewText(PMAIN_WND_INFO Info, ENUM_SERVICE_STATUS_PROCESS *pService, UINT Column)
Definition: listview.c:105
#define ACTION_START
Definition: precomp.h:39
BOOL RunActionWithProgress(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT Action, PVOID Param)
Definition: progress.c:372
#define ACTION_PAUSE
Definition: precomp.h:41
BOOL UpdateServiceStatus(ENUM_SERVICE_STATUS_PROCESS *pService)
Definition: query.c:373
#define LVSTATUS
Definition: precomp.h:31
struct _SERVICEPROPSHEET * PSERVICEPROPSHEET
#define ACTION_STOP
Definition: precomp.h:40
#define ACTION_RESUME
Definition: precomp.h:42
#define IDC_DESCRIPTION
Definition: resource.h:129
#define IDC_START
Definition: resource.h:135
#define IDC_EXEPATH
Definition: resource.h:130
#define IDC_EDIT
Definition: resource.h:134
#define IDC_RESUME
Definition: resource.h:138
#define IDC_START_TYPE
Definition: resource.h:131
#define IDC_START_PARAM
Definition: resource.h:133
#define IDC_DISP_NAME
Definition: resource.h:128
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static VOID InitGeneralPage(PSERVICEPROPSHEET dlgInfo, HWND hwndDlg)
static VOID SetButtonStates(PSERVICEPROPSHEET dlgInfo, HWND hwndDlg)
struct _PAGEDATA * PPAGEDATA
VOID SaveDlgInfo(PPAGEDATA pPageData, HWND hwndDlg)
static VOID SetServiceStatusText(PSERVICEPROPSHEET dlgInfo, HWND hwndDlg)
PSERVICEPROPSHEET dlgInfo
BOOL bDescriptionChanged
BOOL bDisplayNameChanged
BOOL bStartTypeChanged
BOOL bBinaryPathChanged
ENUM_SERVICE_STATUS_PROCESS * pService
Definition: precomp.h:131
PMAIN_WND_INFO Info
Definition: precomp.h:130
Definition: inflate.c:139
#define GWLP_USERDATA
Definition: treelist.c:63
#define HIWORD(l)
Definition: typedefs.h:247
#define EM_SETREADONLY
Definition: winuser.h:2005
#define GetDlgItemText
Definition: winuser.h:5775
#define CBN_SELCHANGE
Definition: winuser.h:1969
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define EN_CHANGE
Definition: winuser.h:2012
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ 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
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
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
651 hwndDlg,
653 (LPARAM)pGlobalData))
654 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
655 break;
656
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}
INT_PTR CALLBACK StickyKeysDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: keyboard.c:68
INT_PTR CALLBACK ToggleKeysDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: keyboard.c:524
INT_PTR CALLBACK FilterKeysDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: keyboard.c:404
#define IDC_TOGGLE_BUTTON
Definition: resource.h:39
#define IDC_FILTER_BOX
Definition: resource.h:36
#define IDD_TOGGLEKEYSOPTIONS
Definition: resource.h:16
#define IDD_FILTERKEYSOPTIONS
Definition: resource.h:13
#define IDD_STICKYKEYSOPTIONS
Definition: resource.h:12
#define IDC_TOGGLE_BOX
Definition: resource.h:38
#define IDC_FILTER_BUTTON
Definition: resource.h:37
#define IDC_KEYBOARD_EXTRA
Definition: resource.h:40
#define IDC_STICKY_BOX
Definition: resource.h:34
#define IDC_STICKY_BUTTON
Definition: resource.h:35
STICKYKEYS stickyKeys
Definition: access.h:29
TOGGLEKEYS toggleKeys
Definition: access.h:33
FILTERKEYS filterKeys
Definition: access.h:31
BOOL bKeyboardPref
Definition: access.h:35
DWORD dwFlags
Definition: winuser.h:3346
DWORD dwFlags
Definition: winuser.h:3520
DWORD dwFlags
Definition: winuser.h:3525
#define SPI_SETSTICKYKEYS
Definition: winuser.h:1398
#define SKF_STICKYKEYSON
Definition: winuser.h:2169
#define SPI_SETFILTERKEYS
Definition: winuser.h:1390
#define SPI_SETTOGGLEKEYS
Definition: winuser.h:1392
#define FKF_FILTERKEYSON
Definition: winuser.h:2119
#define TKF_TOGGLEKEYSON
Definition: winuser.h:2176

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}
INT_PTR CALLBACK MouseKeysDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: mouse.c:19
#define IDD_MOUSEKEYSOPTIONS
Definition: resource.h:19
#define IDC_MOUSE_BUTTON
Definition: resource.h:50
#define IDC_MOUSE_BOX
Definition: resource.h:49
MOUSEKEYS mouseKeys
Definition: access.h:50
DWORD dwFlags
Definition: winuser.h:3402
#define SPI_SETMOUSEKEYS
Definition: winuser.h:1394
#define MKF_MOUSEKEYSON
Definition: winuser.h:2132

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}
static HWND hwndParent
Definition: cryptui.c:300
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
unsigned long DWORD
Definition: ntddk_ex.h:95
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50
DWORD WINAPI GetLastError(void)
Definition: except.c:1040
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:420
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:423
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:419
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONERROR
Definition: winuser.h:781
#define MB_OK
Definition: winuser.h:784

◆ 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:
82 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
83 break;
84
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 IDC_SENTRY_BOX
Definition: resource.h:42
#define IDC_SSHOW_BOX
Definition: resource.h:45
#define IDC_SENTRY_COMBO
Definition: resource.h:44
#define IDC_SENTRY_TEXT
Definition: resource.h:43
static VOID OnInitDialog(HWND hwndDlg, PGLOBAL_DATA pGlobalData)
Definition: sound.c:13
#define DWORD
Definition: nt_native.h:44
BOOL bShowSounds
Definition: access.h:39
SOUNDSENTRY ssSoundSentry
Definition: access.h:38
DWORD iWindowsEffect
Definition: winuser.h:3489
#define CBN_SELENDOK
Definition: winuser.h:1971
#define CB_GETCURSEL
Definition: winuser.h:1933
#define SPI_SETSOUNDSENTRY
Definition: winuser.h:1406
#define SPI_SETSHOWSOUNDS
Definition: winuser.h:1396
#define SSF_SOUNDSENTRYON
Definition: winuser.h:2151

Referenced by SystemApplet().

Variable Documentation

◆ hApplet

HINSTANCE hApplet
extern

Definition at line 17 of file access.c.