Improve swedish translations and add new translations to swedish.
[reactos.git] / base / applications / mscutils / servman / precomp.h
1 #ifndef __SERVMAN_PRECOMP_H
2 #define __SERVMAN_PRECOMP_H
3
4 #define WIN32_NO_STATUS
5 #define _INC_WINDOWS
6 #define COM_NO_WINDOWS_H
7
8 #include <windef.h>
9 #include <winbase.h>
10 #include <wingdi.h>
11 #include <winsvc.h>
12 #include <wincon.h>
13 #include <shlobj.h>
14 #include <commdlg.h>
15 #include <strsafe.h>
16 #include <process.h>
17
18 #include "resource.h"
19
20 #ifdef _MSC_VER
21 #pragma warning(disable : 4100)
22 #endif
23
24 #define NO_ITEM_SELECTED -1
25 #define MAX_KEY_LENGTH 256
26
27 #define LVNAME 0
28 #define LVDESC 1
29 #define LVSTATUS 2
30 #define LVSTARTUP 3
31 #define LVLOGONAS 4
32
33 #define IMAGE_UNKNOWN 0
34 #define IMAGE_SERVICE 1
35 #define IMAGE_DRIVER 2
36
37 #define ACTION_START 1
38 #define ACTION_STOP 2
39 #define ACTION_PAUSE 3
40 #define ACTION_RESUME 4
41 #define ACTION_RESTART 5
42
43 #define ORD_ASCENDING 1
44 #define ORD_DESCENDING -1
45
46 typedef struct _MAIN_WND_INFO
47 {
48 HWND hMainWnd;
49 HWND hListView;
50 HWND hStatus;
51 HWND hTool;
52 HWND hHeader;
53 HMENU hShortcutMenu;
54 int nCmdShow;
55
56 ENUM_SERVICE_STATUS_PROCESS *pAllServices;
57 ENUM_SERVICE_STATUS_PROCESS *pCurrentService;
58 DWORD NumServices;
59
60 INT SelectedItem;/* selection number in the list view */
61 INT SortSelection;
62 INT SortDirection;
63
64 BOOL bDlgOpen;
65 BOOL bInMenuLoop;
66 BOOL bIsUserAnAdmin;
67
68 PVOID pTag;
69
70 } MAIN_WND_INFO, *PMAIN_WND_INFO;
71
72
73 INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
74 INT_PTR CALLBACK CreateDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
75 INT_PTR CALLBACK DeleteDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
76 INT_PTR CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam);
77
78
79 /* servman.c */
80 extern HINSTANCE hInstance;
81 extern HANDLE ProcessHeap;
82
83 /* mainwnd.c */
84 typedef struct _MENU_HINT
85 {
86 WORD CmdId;
87 UINT HintId;
88 } MENU_HINT, *PMENU_HINT;
89
90 VOID SetMenuAndButtonStates(PMAIN_WND_INFO Info);
91 VOID UpdateServiceCount(PMAIN_WND_INFO Info);
92 VOID ChangeListViewText(PMAIN_WND_INFO Info, ENUM_SERVICE_STATUS_PROCESS* pService, UINT Column);
93 BOOL InitMainWindowImpl(VOID);
94 VOID UninitMainWindowImpl(VOID);
95 HWND CreateMainWindow(LPCTSTR lpCaption, int nCmdShow);
96
97 /* listview.c */
98 VOID SetListViewStyle(HWND hListView, DWORD View);
99 VOID ListViewSelectionChanged(PMAIN_WND_INFO Info, LPNMLISTVIEW pnmv);
100 BOOL CreateListView(PMAIN_WND_INFO Info);
101
102 /* start / stop / control */
103 BOOL DoStartService(LPWSTR ServiceName, HANDLE hProgress, LPWSTR lpStartParams);
104 BOOL DoStopService(LPWSTR ServiceName, HANDLE hProgress);
105 BOOL DoControlService(LPWSTR ServiceName, HWND hProgress, DWORD Control);
106
107 /* progress.c */
108 #define DEFAULT_STEP 0
109 BOOL RunActionWithProgress(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT Action, PVOID Param);
110 VOID IncrementProgressBar(HANDLE hProgress, UINT NewPos);
111 VOID CompleteProgressBar(HANDLE hProgress);
112
113 /* query.c */
114 ENUM_SERVICE_STATUS_PROCESS* GetSelectedService(PMAIN_WND_INFO Info);
115 LPQUERY_SERVICE_CONFIG GetServiceConfig(LPWSTR lpServiceName);
116 BOOL SetServiceConfig(LPQUERY_SERVICE_CONFIG pServiceConfig, LPWSTR lpServiceName, LPWSTR lpPassword);
117 LPWSTR GetServiceDescription(LPWSTR lpServiceName);
118 BOOL SetServiceDescription(LPWSTR lpServiceName, LPWSTR lpDescription);
119 LPWSTR GetExecutablePath(LPWSTR lpServiceName);
120 VOID FreeServiceList(PMAIN_WND_INFO Info);
121 BOOL RefreshServiceList(PMAIN_WND_INFO Info);
122 BOOL UpdateServiceStatus(ENUM_SERVICE_STATUS_PROCESS* pService);
123 BOOL GetServiceList(PMAIN_WND_INFO Info);
124
125
126 /* propsheet.c */
127 typedef struct _SERVICEPROPSHEET
128 {
129 PMAIN_WND_INFO Info;
130 ENUM_SERVICE_STATUS_PROCESS *pService;
131
132 } SERVICEPROPSHEET, *PSERVICEPROPSHEET;
133
134 typedef struct _DEPENDDATA
135 {
136 PSERVICEPROPSHEET pDlgInfo;
137 HIMAGELIST hDependsImageList;
138 HWND hDependsWnd;
139 HWND hDependsTreeView1;
140 HWND hDependsTreeView2;
141
142 } DEPENDDATA, *PDEPENDDATA;
143
144
145 HTREEITEM AddItemToTreeView(HWND hTreeView, HTREEITEM hRoot, LPWSTR lpDisplayName, LPWSTR lpServiceName, ULONG serviceType, BOOL bHasChildren);
146
147 /* stop_dependencies */
148 INT_PTR CALLBACK StopDependsDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
149 LPWSTR GetListOfServicesToStop(LPWSTR lpServiceName);
150 BOOL
151 CreateStopDependsDialog(HWND hParent,
152 LPWSTR ServiceName,
153 LPWSTR DisplayName,
154 LPWSTR ServiceList);
155
156 /* tv1_dependencies */
157 BOOL TV1_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName);
158 VOID TV1_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName);
159
160 /* tv2_dependencies */
161 BOOL TV2_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName);
162 VOID TV2_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName);
163 BOOL TV2_HasDependantServices(LPWSTR lpServiceName);
164 LPENUM_SERVICE_STATUS TV2_GetDependants(LPWSTR lpServiceName, LPDWORD lpdwCount);
165
166 VOID OpenPropSheet(PMAIN_WND_INFO Info);
167
168 /* propsheet window procs */
169 INT_PTR CALLBACK DependenciesPageProc(HWND hwndDlg,
170 UINT uMsg,
171 WPARAM wParam,
172 LPARAM lParam);
173 INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg,
174 UINT uMsg,
175 WPARAM wParam,
176 LPARAM lParam);
177 INT_PTR CALLBACK LogonPageProc(HWND hwndDlg,
178 UINT uMsg,
179 WPARAM wParam,
180 LPARAM lParam);
181 INT_PTR CALLBACK RecoveryPageProc(HWND hwndDlg,
182 UINT uMsg,
183 WPARAM wParam,
184 LPARAM lParam);
185
186 /* export.c */
187 VOID ExportFile(PMAIN_WND_INFO Info);
188
189 /* misc.c */
190 INT AllocAndLoadString(OUT LPWSTR *lpTarget,
191 IN HINSTANCE hInst,
192 IN UINT uID);
193 DWORD LoadAndFormatString(IN HINSTANCE hInstance,
194 IN UINT uID,
195 OUT LPWSTR *lpTarget,
196 ...);
197 BOOL StatusBarLoadAndFormatString(IN HWND hStatusBar,
198 IN INT PartId,
199 IN HINSTANCE hInstance,
200 IN UINT uID,
201 ...);
202 BOOL StatusBarLoadString(IN HWND hStatusBar,
203 IN INT PartId,
204 IN HINSTANCE hInstance,
205 IN UINT uID);
206 INT GetTextFromEdit(OUT LPWSTR lpString,
207 IN HWND hDlg,
208 IN UINT Res);
209 VOID GetError(VOID);
210 VOID DisplayString(PWCHAR);
211 HIMAGELIST InitImageList(UINT StartResource,
212 UINT EndResource,
213 UINT Width,
214 UINT Height,
215 ULONG type);
216 VOID
217 ResourceMessageBox(
218 HINSTANCE hInstance,
219 HWND hwnd,
220 UINT uType,
221 UINT uCaptionId,
222 UINT uMessageId);
223
224 #endif /* __SERVMAN_PRECOMP_H */