ReactOS  0.4.15-dev-1184-g23e04ae
sound.c File Reference
#include "access.h"
Include dependency graph for sound.c:

Go to the source code of this file.

Functions

static VOID OnInitDialog (HWND hwndDlg, PGLOBAL_DATA pGlobalData)
 
INT_PTR CALLBACK SoundPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Function Documentation

◆ OnInitDialog()

static VOID OnInitDialog ( HWND  hwndDlg,
PGLOBAL_DATA  pGlobalData 
)
static

Definition at line 13 of file sound.c.

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);
22  SendDlgItemMessage(hwndDlg, IDC_SENTRY_COMBO, CB_ADDSTRING, 0, (LPARAM)szBuffer);
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 }
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
BOOL bShowSounds
Definition: access.h:39
DWORD iWindowsEffect
Definition: winuser.h:3474
#define IDC_SSHOW_BOX
Definition: resource.h:45
HINSTANCE hApplet
Definition: access.c:17
#define SendDlgItemMessage
Definition: winuser.h:5817
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FALSE
Definition: types.h:117
#define CB_ADDSTRING
Definition: winuser.h:1918
SOUNDSENTRY ssSoundSentry
Definition: access.h:38
LONG_PTR LPARAM
Definition: windef.h:208
char TCHAR
Definition: xmlstorage.h:189
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_SENTRY_BOX
Definition: resource.h:42
#define CB_SETCURSEL
Definition: winuser.h:1943
#define SSF_SOUNDSENTRYON
Definition: winuser.h:2136
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define IDC_SENTRY_TEXT
Definition: resource.h:43
#define IDS_SENTRY_NONE
Definition: resource.h:26
unsigned int UINT
Definition: ndis.h:50
#define BST_CHECKED
Definition: winuser.h:197
#define IDC_SENTRY_COMBO
Definition: resource.h:44
#define LoadString
Definition: winuser.h:5794
#define SSF_AVAILABLE
Definition: winuser.h:2135

Referenced by SoundPageProc().

◆ 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:39
#define SystemParametersInfo
Definition: winuser.h:5833
DWORD iWindowsEffect
Definition: winuser.h:3474
#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 FALSE
Definition: types.h:117
#define CBN_SELENDOK
Definition: winuser.h:1963
#define LPPROPSHEETPAGE
Definition: prsht.h:390
SOUNDSENTRY ssSoundSentry
Definition: access.h:38
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:344
#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
Definition: inflate.c:139
#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:5818
#define HIWORD(l)
Definition: typedefs.h:247
#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().