#ifndef PPPC_H #define PPPC_H #include "Config.h" #include #define APP_NAME "Parallel Port Power Controller" #define WM_ICON_NOTIFY (WM_APP + 42) class PPPC { public: enum ConfigEntryMode { AUTO = 0, MANUAL_OFF = 1, MANUAL_ON = 2 }; static const char * ConfigEntryCaptions[3]; PPPC(HINSTANCE hInstance, const char * config_file = NULL); ~PPPC(); BOOL mainLoop(); protected: void event_start(); void event_exit(); void event_lock(); void event_unlock(); void update_pins(); void updateConfigMenus(int i); Config m_config; HWND m_hWnd; NOTIFYICONDATA m_nid; unsigned char m_pins; unsigned char m_previous_pins; HMENU m_popupMenu; std::vector m_menus; std::vector m_modes; }; /* non class-member functions */ void addMenuItem(HMENU hMenu, const CHAR * itemstr, WORD id); HMENU addMenuSubMenu(HMENU hMenu, const CHAR * itemstr, WORD id); void updateMenuInfo(HMENU hMenu, int index, const CHAR * itemstr, WORD id, bool checked); #endif