ReactOS 0.4.15-dev-8227-g32d615f
alarms.c File Reference
#include "powercfg.h"
Include dependency graph for alarms.c:

Go to the source code of this file.

Functions

static BOOLEAN Ala_InitData (HWND hwndDlg)
 
INT_PTR CALLBACK AlarmsDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Function Documentation

◆ Ala_InitData()

static BOOLEAN Ala_InitData ( HWND  hwndDlg)
static

Definition at line 15 of file alarms.c.

16{
17 TCHAR szAction[MAX_PATH];
18 TCHAR szText[MAX_PATH];
19 TCHAR szSound[MAX_PATH];
20 TCHAR szMessage[MAX_PATH];
21 TCHAR szTemp[MAX_PATH];
22 TCHAR szBatteryLevel[MAX_PATH];
23 TCHAR szProgram[MAX_PATH];
24
26 {
27 return FALSE;
28 }
29
31 {
34
36 {
38 SetDlgItemText(hwndDlg, IDC_ALARMVALUE1, szBatteryLevel);
39 }
40
43 (WPARAM)TRUE,
44 (LPARAM)MAKELONG(0, 100));
47 (WPARAM)TRUE,
48 (LPARAM)20);
51 (WPARAM)TRUE,
53
55 {
56 SetDlgItemText(hwndDlg, IDC_ALARMAKTION1, szAction);
57 }
58
59 memset(szMessage, 0x0, sizeof(szMessage));
61
63 {
65 {
67 {
68 _stprintf(szMessage,_T("%s, %s"),szSound,szText);
69 }
70 }
71 else
72 {
73 if (LoadString(hApplet, IDS_TEXT, szText, MAX_PATH))
74 {
75 _stprintf(szMessage,_T("%s"),szText);
76 }
77 }
78 }
79 else
80 {
82 {
83 if (LoadString(hApplet, IDS_SOUND, szSound, MAX_PATH))
84 {
85 _stprintf(szMessage,_T("%s"),szSound);
86 }
87 }
88 }
89
90 SetDlgItemText(hwndDlg, IDC_ALARMMSG1, szMessage);
91
93 {
94 SetDlgItemText(hwndDlg, IDC_ALARMPROG1, szProgram);
95 }
96 }
97
99 {
100 CheckDlgButton(hwndDlg, IDC_ALARM2,
102
103 if (LoadString(hApplet, IDS_PERCENT, szTemp, MAX_PATH))
104 {
106 SetDlgItemText(hwndDlg, IDC_ALARMVALUE2, szBatteryLevel);
107 }
108
111 (WPARAM)TRUE,
112 (LPARAM)MAKELONG(0, 100));
115 (WPARAM)TRUE,
117
119 {
120 SetDlgItemText(hwndDlg, IDC_ALARMAKTION2, szAction);
121 }
122
123 memset(szMessage, 0x0, sizeof(szMessage));
125
127 {
129 {
131 {
132 _stprintf(szMessage,_T("%s, %s"),szSound,szText);
133 }
134 }
135 else
136 {
137 if (LoadString(hApplet, IDS_TEXT, szText, MAX_PATH))
138 {
139 _stprintf(szMessage,_T("%s"),szText);
140 }
141 }
142 }
143 else
144 {
146 {
147 if (LoadString(hApplet, IDS_SOUND, szSound, MAX_PATH))
148 {
149 _stprintf(szMessage,_T("%s"),szSound);
150 }
151 }
152 }
153
154 SetDlgItemText(hwndDlg, IDC_ALARMMSG2, szMessage);
155
157 {
158 SetDlgItemText(hwndDlg, IDC_ALARMPROG2, szProgram);
159 }
160 }
161
162 return TRUE;
163}
#define IDS_TEXT
Definition: resource.h:3
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HINSTANCE hApplet
Definition: access.c:17
#define IDC_ALARMAKTION1
Definition: resource.h:89
#define IDS_SOUND
Definition: resource.h:9
#define IDC_ALARMVALUE2
Definition: resource.h:86
#define IDS_PERCENT
Definition: resource.h:8
#define IDC_ALARMAKTION2
Definition: resource.h:92
#define IDC_ALARMBAR2
Definition: resource.h:84
#define IDC_ALARM2
Definition: resource.h:88
#define IDC_ALARMPROG2
Definition: resource.h:93
#define IDS_NOACTION
Definition: resource.h:22
#define IDC_ALARMPROG1
Definition: resource.h:90
#define IDC_ALARMMSG1
Definition: resource.h:82
#define IDS_PowerActionNone1
Definition: resource.h:23
#define IDC_ALARMVALUE1
Definition: resource.h:85
#define IDC_ALARM1
Definition: resource.h:87
#define IDC_ALARMBAR1
Definition: resource.h:83
#define IDC_ALARMMSG2
Definition: resource.h:91
#define IDS_PowerActionNone2
Definition: resource.h:31
#define MAX_PATH
Definition: compat.h:34
#define _stprintf
Definition: utility.h:124
#define POWER_LEVEL_USER_NOTIFY_SOUND
Definition: ntpoapi.h:424
#define DISCHARGE_POLICY_CRITICAL
Definition: ntpoapi.h:430
#define DISCHARGE_POLICY_LOW
Definition: ntpoapi.h:431
#define POWER_LEVEL_USER_NOTIFY_TEXT
Definition: ntpoapi.h:423
#define LOWORD(l)
Definition: pedump.c:82
GLOBAL_POWER_POLICY gGPP
Definition: powercfg.c:23
BOOLEAN WINAPI ReadGlobalPwrPolicy(PGLOBAL_POWER_POLICY pGlobalPowerPolicy)
Definition: powrprof.c:521
#define TBM_SETRANGE
Definition: commctrl.h:2037
#define TBM_SETPOS
Definition: commctrl.h:2036
#define TBM_SETTICFREQ
Definition: commctrl.h:2050
#define memset(x, y, z)
Definition: compat.h:39
GLOBAL_USER_POWER_POLICY user
Definition: powrprof.h:42
SYSTEM_POWER_LEVEL DischargePolicy[NUM_DISCHARGE_POLICIES]
Definition: powrprof.h:38
POWER_ACTION Action
Definition: ntpoapi.h:408
POWER_ACTION_POLICY PowerPolicy
Definition: winnt_old.h:3935
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define _T(x)
Definition: vfdio.h:22
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define BST_UNCHECKED
Definition: winuser.h:199
#define LoadString
Definition: winuser.h:5828
#define SendDlgItemMessage
Definition: winuser.h:5851
#define SetDlgItemText
Definition: winuser.h:5858
#define BST_CHECKED
Definition: winuser.h:197
char TCHAR
Definition: xmlstorage.h:189

Referenced by AlarmsDlgProc().

◆ AlarmsDlgProc()

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

Definition at line 167 of file alarms.c.

171{
174
175 switch (uMsg)
176 {
177 case WM_INITDIALOG:
178 if (!Ala_InitData(hwndDlg))
179 {
180 // TODO:
181 // Handle initialization error
182 }
183 return TRUE;
184
185 default:
186 break;
187 }
188
189 return FALSE;
190}
static BOOLEAN Ala_InitData(HWND hwndDlg)
Definition: alarms.c:15
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define WM_INITDIALOG
Definition: winuser.h:1739

Referenced by Applet1().