ReactOS 0.4.16-dev-306-g647d351
sound.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Accessibility Control Panel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/cpl/access/sound.c
5 * PURPOSE: Sound-related accessibility settings
6 * COPYRIGHT: Copyright 2004 Johannes Anderwald (johannes.anderwald@reactos.org)
7 * Copyright 2007 Eric Kohl
8 */
9
10#include "access.h"
11
12static VOID
13OnInitDialog(HWND hwndDlg, PGLOBAL_DATA pGlobalData)
14{
15 TCHAR szBuffer[256];
16 UINT i;
17
18 /* Add strings to the combo-box */
19 for (i = 0; i < 4; i++)
20 {
21 LoadString(hApplet, IDS_SENTRY_NONE + i, szBuffer, 256);
23 }
24
25 /* Select a combo-box item */
27
28 /* Initialize SoundSentry settings */
29 if (!(pGlobalData->ssSoundSentry.dwFlags & SSF_AVAILABLE))
30 {
34 }
35 else
36 {
37 if (pGlobalData->ssSoundSentry.dwFlags & SSF_SOUNDSENTRYON)
38 {
40 }
41 else
42 {
45 }
46 }
47
48 /* Initialize ShowSounds settings */
49 if (pGlobalData->bShowSounds)
51}
52
53
54/* Property page dialog callback */
57 UINT uMsg,
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;
80 EnableWindow(GetDlgItem(hwndDlg, IDC_SENTRY_TEXT), (pGlobalData->ssSoundSentry.dwFlags & SSF_SOUNDSENTRYON)?TRUE:FALSE);
81 EnableWindow(GetDlgItem(hwndDlg, IDC_SENTRY_COMBO), (pGlobalData->ssSoundSentry.dwFlags & SSF_SOUNDSENTRYON)?TRUE:FALSE);
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}
struct _GLOBAL_DATA * PGLOBAL_DATA
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HINSTANCE hApplet
Definition: access.c:17
#define IDC_SENTRY_BOX
Definition: resource.h:42
#define IDS_SENTRY_NONE
Definition: resource.h:26
#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
INT_PTR CALLBACK SoundPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: sound.c:56
#define CALLBACK
Definition: compat.h:35
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
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define DWORD
Definition: nt_native.h:44
#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
#define WM_NOTIFY
Definition: richedit.h:61
BOOL bShowSounds
Definition: access.h:39
SOUNDSENTRY ssSoundSentry
Definition: access.h:38
Definition: inflate.c:139
DWORD iWindowsEffect
Definition: winuser.h:3502
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT_PTR
Definition: typedefs.h:64
#define HIWORD(l)
Definition: typedefs.h:247
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define DWLP_USER
Definition: winuser.h:875
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define WM_COMMAND
Definition: winuser.h:1743
#define CB_SETCURSEL
Definition: winuser.h:1964
#define WM_INITDIALOG
Definition: winuser.h:1742
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SPIF_SENDCHANGE
Definition: winuser.h:1575
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1574
#define CB_ADDSTRING
Definition: winuser.h:1939
#define SSF_AVAILABLE
Definition: winuser.h:2163
#define SendMessage
Definition: winuser.h:5855
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define LoadString
Definition: winuser.h:5831
#define CBN_SELENDOK
Definition: winuser.h:1984
#define SystemParametersInfo
Definition: winuser.h:5870
#define CB_GETCURSEL
Definition: winuser.h:1946
#define SPI_SETSOUNDSENTRY
Definition: winuser.h:1419
#define SendDlgItemMessage
Definition: winuser.h:5854
#define SPI_SETSHOWSOUNDS
Definition: winuser.h:1409
#define BST_CHECKED
Definition: winuser.h:197
#define SSF_SOUNDSENTRYON
Definition: winuser.h:2164
char TCHAR
Definition: xmlstorage.h:189