1 /*
2  * PROJECT:         ReactOS Utility Manager Resources DLL (UManDlg.dll)
3  * LICENSE:         GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE:         DLL header file
5  * COPYRIGHT:       Copyright 2020 George Bișoc (george.bisoc@reactos.org)
6  */
7 
8 #ifndef _UMANDLG_H
9 #define _UMANDLG_H
10 
11 /* INCLUDES ******************************************************************/
12 
13 #include <stdlib.h>
14 #include <windows.h>
15 #include <commctrl.h>
16 #include <tlhelp32.h>
17 #include <windowsx.h>
18 #include <debug.h>
19 #include <wchar.h>
20 #include <strsafe.h>
21 
22 #include "resource.h"
23 
24 /* DEFINES ********************************************************************/
25 
26 #define MAX_BUFFER 256
27 
28 /* TYPES **********************************************************************/
29 
30 typedef struct
31 {
32     HINSTANCE hInstance;
33     HICON     hIcon;
34     UINT_PTR  iTimer;
35     INT       iSelectedIndex;
36     HWND      hDlgCtlStart;
37     HWND      hDlgCtlStop;
38     HWND      hListDlg;
39     HWND      hMainDlg;
40     WCHAR     szRunning[MAX_BUFFER];
41     WCHAR     szNotRunning[MAX_BUFFER];
42     WCHAR     szGrpBoxTitle[MAX_BUFFER];
43 } UTILMAN_GLOBALS;
44 
45 typedef struct _UTILMAN_STATE
46 {
47     LPCWSTR lpszProgram;
48     UINT    uNameId;
49     WCHAR   szResource[MAX_BUFFER];
50     BOOL    bState;
51 } UTILMAN_STATE, *PUTILMAN_STATE;
52 
53 typedef struct _REGISTRY_SETTINGS
54 {
55     /* Accessibility Registry settings */
56     LPCWSTR lpszAppPath;
57     DWORD dwAppType;
58     DWORD dwClientControlCode;
59     LPCWSTR lpszAppName;
60     LPCWSTR lpszErrorOnLaunch;
61     BOOL bHideClient;
62     BOOL bStartWithUtilman;
63     BOOL bStartWithROS;
64     LPCWSTR lpszHungRespondAction;
65     DWORD dwHungTimeOut;
66 
67     /* Utility Manager Registry settings */
68     BOOL bShowWarning;
69 } REGISTRY_SETTINGS, *PREGISTRY_SETTINGS;
70 
71 typedef struct _REGISTRY_DATA
72 {
73     /* On-Screen Keyboard Registry data */
74     LPCWSTR lpszOskPath;
75     LPCWSTR lpszOskDisplayName;
76 
77     /* Magnify Registry data */
78     LPCWSTR lpszMagnifyPath;
79     LPCWSTR lpszMagnifyDisplayName;
80 } REGISTRY_DATA, *PREGISTRY_DATA;
81 
82 /* ENUMERATIONS ***************************************************************/
83 
84 typedef enum _WRITE_REGISTRY
85 {
86     REGISTRY_ACCESSIBILITY,
87     REGISTRY_UTILMAN
88 } WRITE_REGISTRY, *PWRITE_REGISTRY;
89 
90 /* DECLARATIONS ***************************************************************/
91 
92 /* umandlg.c */
93 VOID InitUtilsList(IN BOOL bInitGui);
94 BOOL DlgInitHandler(IN HWND hDlg);
95 VOID ShowAboutDlg(IN HWND hDlgParent);
96 VOID GroupBoxUpdateTitle(VOID);
97 VOID UpdateUtilityState(IN BOOL bUtilState);
98 INT_PTR APIENTRY DlgProc(IN HWND hDlg, IN UINT Msg, IN WPARAM wParam, IN LPARAM lParam);
99 INT ListBoxRefreshContents(VOID);
100 BOOL WINAPI UManStartDlg(VOID);
101 
102 /* process.c */
103 DWORD GetProcessID(IN LPCWSTR lpszProcessName);
104 BOOL IsProcessRunning(IN LPCWSTR lpszProcessName);
105 BOOL LaunchProcess(IN LPCWSTR lpszProcessName);
106 BOOL CloseProcess(IN LPCWSTR lpszProcessName);
107 
108 /* registry.c */
109 BOOL InitAppRegKey(IN HKEY hPredefinedKey, IN LPCWSTR lpszSubKey, OUT PHKEY phKey, OUT LPDWORD lpdwDisposition);
110 BOOL QueryAppSettings(IN HKEY hKey, IN LPCWSTR lpszSubKey, IN LPCWSTR lpszRegValue, OUT PVOID ReturnedData, IN OUT LPDWORD lpdwSizeData);
111 BOOL SaveAppSettings(IN HKEY hKey, IN LPCWSTR lpszRegValue, IN DWORD dwRegType, IN PVOID Data, IN DWORD cbSize);
112 
113 /* Struct variable declaration */
114 extern UTILMAN_GLOBALS Globals;
115 extern REGISTRY_SETTINGS Settings;
116 extern REGISTRY_DATA RegData;
117 
118 #endif /* UMANDLG_H_ */
119 
120 /* EOF */
121