forked from tdhoward/sample-wxwidgets-windows-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice.h
36 lines (28 loc) · 791 Bytes
/
service.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// service.h
#include <wx/wx.h>
#define SERVICE_NAME L"My Sample WX Service"
// arbitrary event ID so that our event handler is not processing every event generated
// by wxWidgets.
#define EvtID 42
// Also arbitrary event numbers, just so we can keep track of what we are signalling
#define E_EXIT 5
// add more here as necessary
class MainApp: public wxApp
{
private:
bool openSCM(void);
void closeSCM(void);
bool isInstalled(void);
void install(void);
void uninstall(void);
void EvtHndlr(wxThreadEvent &);
public:
virtual bool OnInit();
virtual int OnExit();
};
// timer used for doing service operations
class svcTimer : public wxTimer
{
public:
void Notify(); // called every x seconds
};