sync to trunk revision 36500
[reactos.git] / reactos / base / applications / mscutils / servman / precomp.h
1 #ifndef __SERVMAN_PRECOMP_H
2 #define __SERVMAN_PRECOMP_H
3
4 //#define WIN32_LEAN_AND_MEAN
5 #include <windows.h>
6 #include <windowsx.h> /* GET_X/Y_LPARAM */
7 #include <stdio.h>
8 #include <tchar.h>
9 #include <commctrl.h>
10 #include <shlobj.h>
11 #include "resource.h"
12
13 #ifdef _MSC_VER
14 #pragma warning(disable : 4100)
15 #endif
16
17 #define NO_ITEM_SELECTED -1
18 #define MAX_KEY_LENGTH 256
19
20 #define LVNAME 0
21 #define LVDESC 1
22 #define LVSTATUS 2
23 #define LVSTARTUP 3
24 #define LVLOGONAS 4
25
26 typedef struct _MAIN_WND_INFO
27 {
28 HWND hMainWnd;
29 HWND hListView;
30 HWND hStatus;
31 HWND hTool;
32 HMENU hShortcutMenu;
33 int nCmdShow;
34
35 ENUM_SERVICE_STATUS_PROCESS *pAllServices;
36 ENUM_SERVICE_STATUS_PROCESS *pCurrentService;
37
38 INT SelectedItem;/* selection number in the list view */
39 BOOL bDlgOpen;
40 BOOL bInMenuLoop;
41 BOOL bIsUserAnAdmin;
42
43 } MAIN_WND_INFO, *PMAIN_WND_INFO;
44
45
46 INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
47 INT_PTR CALLBACK CreateDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
48 INT_PTR CALLBACK DeleteDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
49 INT_PTR CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam);
50
51
52 /* servman.c */
53 extern HINSTANCE hInstance;
54 extern HANDLE ProcessHeap;
55
56 /* mainwnd.c */
57 typedef struct _MENU_HINT
58 {
59 WORD CmdId;
60 UINT HintId;
61 } MENU_HINT, *PMENU_HINT;
62
63 VOID SetMenuAndButtonStates(PMAIN_WND_INFO Info);
64 VOID UpdateServiceCount(PMAIN_WND_INFO Info);
65 VOID ChangeListViewText(PMAIN_WND_INFO Info, ENUM_SERVICE_STATUS_PROCESS* pService, UINT Column);
66 BOOL InitMainWindowImpl(VOID);
67 VOID UninitMainWindowImpl(VOID);
68 HWND CreateMainWindow(LPCTSTR lpCaption, int nCmdShow);
69
70 /* listview.c */
71 VOID SetListViewStyle(HWND hListView, DWORD View);
72 VOID ListViewSelectionChanged(PMAIN_WND_INFO Info, LPNMLISTVIEW pnmv);
73 BOOL CreateListView(PMAIN_WND_INFO Info);
74
75 /* start */
76 BOOL DoStart(PMAIN_WND_INFO Info);
77
78 /* control */
79 BOOL Control(PMAIN_WND_INFO Info, HWND hProgDlg, DWORD Control);
80 BOOL DoStop(PMAIN_WND_INFO Info);
81 BOOL DoPause(PMAIN_WND_INFO Info);
82 BOOL DoResume(PMAIN_WND_INFO Info);
83
84 /* progress.c */
85 HWND CreateProgressDialog(HWND hParent, LPTSTR lpServiceName, UINT Event);
86 VOID IncrementProgressBar(HWND hProgDlg);
87 VOID CompleteProgressBar(HWND hProgDlg);
88
89 /* query.c */
90 ENUM_SERVICE_STATUS_PROCESS* GetSelectedService(PMAIN_WND_INFO Info);
91 LPQUERY_SERVICE_CONFIG GetServiceConfig(LPTSTR lpServiceName);
92 BOOL SetServiceConfig(LPQUERY_SERVICE_CONFIG pServiceConfig, LPTSTR lpServiceName, LPTSTR lpPassword);
93 LPTSTR GetServiceDescription(LPTSTR lpServiceName);
94 BOOL SetServiceDescription(LPTSTR lpServiceName, LPTSTR lpDescription);
95 LPTSTR GetExecutablePath(LPTSTR lpServiceName);
96 BOOL RefreshServiceList(PMAIN_WND_INFO Info);
97 BOOL UpdateServiceStatus(ENUM_SERVICE_STATUS_PROCESS* pService);
98 BOOL GetServiceList(PMAIN_WND_INFO Info, DWORD *NumServices);
99
100 /* reg */
101 BOOL SetDescription(LPTSTR, LPTSTR);
102
103 /* propsheet.c */
104 LONG APIENTRY OpenPropSheet(PMAIN_WND_INFO Info);
105
106 /* export.c */
107 VOID ExportFile(PMAIN_WND_INFO Info);
108
109 /* misc.c */
110 INT AllocAndLoadString(OUT LPTSTR *lpTarget,
111 IN HINSTANCE hInst,
112 IN UINT uID);
113 DWORD LoadAndFormatString(IN HINSTANCE hInstance,
114 IN UINT uID,
115 OUT LPTSTR *lpTarget,
116 ...);
117 BOOL StatusBarLoadAndFormatString(IN HWND hStatusBar,
118 IN INT PartId,
119 IN HINSTANCE hInstance,
120 IN UINT uID,
121 ...);
122 BOOL StatusBarLoadString(IN HWND hStatusBar,
123 IN INT PartId,
124 IN HINSTANCE hInstance,
125 IN UINT uID);
126 INT GetTextFromEdit(OUT LPTSTR lpString,
127 IN HWND hDlg,
128 IN UINT Res);
129 VOID GetError(VOID);
130 VOID DisplayString(PTCHAR);
131 HIMAGELIST InitImageList(UINT NumButtons,
132 UINT StartResource,
133 UINT Width,
134 UINT Height);
135
136 #endif /* __SERVMAN_PRECOMP_H */