#include <windows.h>#include <windowsx.h>#include <commctrl.h>#include <objbase.h>#include <shlobj.h>#include <stdlib.h>#include <stdio.h>#include "ApacheMonitor.h"Include dependency graph for ApacheMonitor.c:

Go to the source code of this file.
Defines | |
| #define | _WIN32_WINNT 0x0400 |
| #define | OS_VERSION_WIN9X 1 |
| #define | OS_VERSION_WINNT 2 |
| #define | OS_VERSION_WIN2K 3 |
| #define | MAX_APACHE_SERVICES 128 |
| #define | MAX_APACHE_COMPUTERS 32 |
| #define | WM_TRAYMESSAGE (WM_APP+1) |
| #define | WM_UPDATEMESSAGE (WM_USER+1) |
| #define | WM_MANAGEMESSAGE (WM_USER+2) |
| #define | WM_TIMER_REFRESH 10 |
| #define | WM_TIMER_RESCAN 11 |
| #define | SERVICE_APACHE_RESTART 128 |
| #define | XBITMAP 16 |
| #define | YBITMAP 16 |
| #define | MAX_LOADSTRING 100 |
| #define | REFRESH_TIME 2000 |
| #define | RESCAN_TIME 20000 |
Typedefs | |
| typedef _st_APACHE_SERVICE | ST_APACHE_SERVICE |
| typedef _st_MONITORED_COMPUTERS | ST_MONITORED_COMP |
Functions | |
| void | am_ClearServicesSt () |
| void | am_ClearComputersSt () |
| BOOL | am_IsComputerConnected (LPSTR szComputerName) |
| void | am_DisconnectComputer (LPSTR szComputerName) |
| void | ErrorMessage (LPCSTR szError, BOOL bFatal) |
| BOOL | am_ConnectComputer (LPSTR szComputerName) |
| LPSTR | GetStringRes (int id) |
| BOOL | GetSystemOSVersion (LPDWORD dwVersion) |
| static VOID | ShowNotifyIcon (HWND hWnd, DWORD dwMessage) |
| void | appendMenuItem (HMENU hMenu, UINT uMenuId, LPSTR szName, BOOL fDefault, BOOL fEnabled) |
| void | appendServiceMenu (HMENU hMenu, UINT uMenuId, LPSTR szServiceName, BOOL fRunning) |
| void | ShowTryPopupMenu (HWND hWnd) |
| void | ShowTryServicesMenu (HWND hWnd) |
| BOOL | CenterWindow (HWND hwndChild) |
| static void | addListBoxItem (HWND hDlg, LPSTR lpStr, HBITMAP hBmp) |
| static void | addListBoxString (HWND hListBox, LPSTR lpStr) |
| static DWORD WINAPI | ConsoleOutputThread (LPVOID lpThreadParameter) |
| DWORD WINAPI | ConsoleWaitingThread (LPVOID lpThreadParameter) |
| BOOL | RunRedirectedConsole (LPSTR szCmdLine) |
| BOOL | RunAndForgetConsole (LPSTR szCmdLine, BOOL bRedirectConsole) |
| BOOL | ApacheManageService (LPCSTR szServiceName, LPCSTR szImagePath, LPSTR szComputerName, DWORD dwCommand) |
| BOOL | IsServiceRunning (LPCSTR szServiceName, LPCSTR szComputerName, LPDWORD lpdwPid) |
| BOOL | FindRunningServices (void) |
| BOOL | GetApacheServicesStatus () |
| LRESULT CALLBACK | ConnectDlgProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) |
| LRESULT CALLBACK | ServiceDlgProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) |
| LRESULT CALLBACK | WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) |
| HWND | CreateMainWindow (HINSTANCE hInstance) |
| int WINAPI | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) |
Variables | |
| HINSTANCE | g_hInstance = NULL |
| CHAR * | g_szTitle |
| CHAR * | g_szWindowClass |
| HICON | g_icoStop |
| HICON | g_icoRun |
| UINT | g_bUiTaskbarCreated |
| DWORD | g_dwOSVersion |
| BOOL | g_bDlgServiceOn = FALSE |
| BOOL | g_bConsoleRun = FALSE |
| ST_APACHE_SERVICE | g_stServices [MAX_APACHE_SERVICES] |
| ST_MONITORED_COMP | g_stComputers [MAX_APACHE_COMPUTERS] |
| HBITMAP | g_hBmpStart |
| HBITMAP | g_hBmpStop |
| HBITMAP | g_hBmpPicture |
| HBITMAP | g_hBmpOld |
| BOOL | g_bRescanServices |
| HWND | g_hwndServiceDlg |
| HWND | g_hwndMain |
| HWND | g_hwndStdoutList |
| HWND | g_hwndConnectDlg |
| HCURSOR | g_hCursorHourglass |
| HCURSOR | g_hCursorArrow |
| HANDLE | g_hpipeOutRead |
| HANDLE | g_hpipeOutWrite |
| HANDLE | g_hpipeInRead |
| HANDLE | g_hpipeInWrite |
| HANDLE | g_hpipeStdError |
| LANGID | g_LangID |
| PROCESS_INFORMATION | g_lpRedirectProc |
| CRITICAL_SECTION | g_stcSection |
| LPSTR | g_szLocalHost |
| static CHAR * | g_lpMsg [IDS_MSG_LAST-IDS_MSG_FIRST+1] |
|
|
Definition at line 26 of file ApacheMonitor.c. |
|
|
Definition at line 49 of file ApacheMonitor.c. Referenced by am_ClearComputersSt(), am_ConnectComputer(), am_DisconnectComputer(), and WinMain(). |
|
|
Definition at line 48 of file ApacheMonitor.c. Referenced by am_ClearServicesSt(), GetApacheServicesStatus(), and WinMain(). |
|
|
Definition at line 59 of file ApacheMonitor.c. Referenced by addListBoxString(), and WinMain(). |
|
|
Definition at line 46 of file ApacheMonitor.c. Referenced by GetSystemOSVersion(), ServiceDlgProc(), and WndProc(). |
|
|
Definition at line 44 of file ApacheMonitor.c. Referenced by ApacheManageService(), GetSystemOSVersion(), IsServiceRunning(), and RunAndForgetConsole(). |
|
|
Definition at line 45 of file ApacheMonitor.c. Referenced by GetSystemOSVersion(), ServiceDlgProc(), and ShowTryPopupMenu(). |
|
|
Definition at line 60 of file ApacheMonitor.c. Referenced by WndProc(). |
|
|
Definition at line 61 of file ApacheMonitor.c. Referenced by WndProc(). |
|
|
Definition at line 56 of file ApacheMonitor.c. |
|
|
Definition at line 53 of file ApacheMonitor.c. Referenced by ServiceDlgProc(). |
|
|
Definition at line 54 of file ApacheMonitor.c. Referenced by WndProc(). |
|
|
Definition at line 55 of file ApacheMonitor.c. Referenced by ConnectDlgProc(), ServiceDlgProc(), and WndProc(). |
|
|
Definition at line 51 of file ApacheMonitor.c. Referenced by ShowNotifyIcon(), and WndProc(). |
|
|
Definition at line 52 of file ApacheMonitor.c. Referenced by ServiceDlgProc(), and WndProc(). |
|
|
Definition at line 57 of file ApacheMonitor.c. Referenced by ServiceDlgProc(), and WinMain(). |
|
|
Definition at line 58 of file ApacheMonitor.c. Referenced by ServiceDlgProc(), and WinMain(). |
|
|
|
|
|
|
|
||||||||||||||||
|
Definition at line 494 of file ApacheMonitor.c. Referenced by ServiceDlgProc(). |
|
||||||||||||
|
Definition at line 503 of file ApacheMonitor.c. References g_bDlgServiceOn, and MAX_LOADSTRING. Referenced by ApacheManageService(), and ConsoleOutputThread(). |
|
|
Definition at line 143 of file ApacheMonitor.c. References MAX_APACHE_COMPUTERS. Referenced by WinMain(). |
|
|
Definition at line 116 of file ApacheMonitor.c. References MAX_APACHE_SERVICES. Referenced by GetApacheServicesStatus(), and WinMain(). |
|
|
Definition at line 219 of file ApacheMonitor.c. References ERROR_SUCCESS, ErrorMessage(), FALSE, g_lpMsg, _st_MONITORED_COMPUTERS::hRegistry, IDS_MSG_ECONNECT, IDS_MSG_FIRST, MAX_APACHE_COMPUTERS, MAX_PATH, NULL, strdup(), _st_MONITORED_COMPUTERS::szComputerName, and TRUE. Referenced by ConnectDlgProc(). Here is the call graph for this function: ![]() |
|
|
Definition at line 170 of file ApacheMonitor.c. References _st_MONITORED_COMPUTERS::hRegistry, MAX_APACHE_COMPUTERS, NULL, and _st_MONITORED_COMPUTERS::szComputerName. Referenced by ServiceDlgProc(). |
|
|
Definition at line 157 of file ApacheMonitor.c. |
|
||||||||||||||||||||
|
Definition at line 674 of file ApacheMonitor.c. References addListBoxString(), BOOL, ErrorMessage(), FALSE, g_bConsoleRun, g_bRescanServices, g_dwOSVersion, g_hCursorArrow, g_hCursorHourglass, g_hwndStdoutList, g_lpMsg, IDS_MSG_FIRST, IDS_MSG_SRVFAILED, IDS_MSG_SRVRESTART, IDS_MSG_SRVRESTARTED, IDS_MSG_SRVSTART, IDS_MSG_SRVSTARTED, IDS_MSG_SRVSTOP, IDS_MSG_SRVSTOPPED, MAX_PATH, NULL, OS_VERSION_WIN9X, RunAndForgetConsole(), SERVICE_APACHE_RESTART, strstr(), and TRUE. Referenced by ServiceDlgProc(), and WndProc(). Here is the call graph for this function: ![]() |
|
||||||||||||||||||||||||
|
Definition at line 347 of file ApacheMonitor.c. References FALSE. Referenced by appendServiceMenu(), and ShowTryPopupMenu(). |
|
||||||||||||||||||||
|
Definition at line 374 of file ApacheMonitor.c. References appendMenuItem(), FALSE, g_hBmpStart, g_hBmpStop, g_lpMsg, IDM_SM_RESTART, IDM_SM_SERVICE, IDM_SM_START, IDM_SM_STOP, IDS_MSG_FIRST, IDS_MSG_SRESTART, IDS_MSG_SSTART, and IDS_MSG_SSTOP. Referenced by ShowTryServicesMenu(). Here is the call graph for this function: ![]() |
|
|
Definition at line 465 of file ApacheMonitor.c. References BOOL. Referenced by ConnectDlgProc(), and ServiceDlgProc(). |
|
||||||||||||||||||||
|
Definition at line 1056 of file ApacheMonitor.c. References am_ConnectComputer(), CenterWindow(), FALSE, g_hwndConnectDlg, g_hwndMain, IDC_COMPUTER, IDC_LBROWSE, NULL, TRUE, and WM_TIMER_RESCAN. Referenced by ServiceDlgProc(). Here is the call graph for this function: ![]() |
|
|
Definition at line 521 of file ApacheMonitor.c. References addListBoxString(), BYTE, CloseHandle, g_hpipeInWrite, g_hpipeOutRead, g_hpipeStdError, g_hwndStdoutList, MAX_PATH, NULL, and TRUE. Referenced by RunRedirectedConsole(). Here is the call graph for this function: ![]() |
|
|
Definition at line 557 of file ApacheMonitor.c. References CloseHandle, FALSE, g_bConsoleRun, g_hCursorArrow, g_lpRedirectProc, and WaitForSingleObject. Referenced by RunRedirectedConsole(). |
|
|
Definition at line 1639 of file ApacheMonitor.c. References ErrorMessage(), g_dwOSVersion, g_hCursorArrow, g_szTitle, g_szWindowClass, GetSystemOSVersion(), IDI_APSRVMON, NULL, TRUE, and WndProc(). Referenced by WinMain(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 195 of file ApacheMonitor.c. References g_LangID, g_lpMsg, IDS_MSG_ERROR, IDS_MSG_FIRST, and NULL. Referenced by am_ConnectComputer(), ApacheManageService(), CreateMainWindow(), GetApacheServicesStatus(), RunRedirectedConsole(), and WinMain(). |
|
|
Definition at line 931 of file ApacheMonitor.c. References BOOL, _st_APACHE_SERVICE::dwPid, FALSE, IsServiceRunning(), NULL, and TRUE. Referenced by GetApacheServicesStatus(), and WndProc(). Here is the call graph for this function: ![]() |
|
|
Definition at line 952 of file ApacheMonitor.c. References am_ClearServicesSt(), ERROR_SUCCESS, ErrorMessage(), FALSE, FindRunningServices(), g_bRescanServices, g_szLocalHost, _st_MONITORED_COMPUTERS::hRegistry, MAX_APACHE_SERVICES, MAX_PATH, NULL, strdup(), strstr(), _st_APACHE_SERVICE::szComputerName, _st_APACHE_SERVICE::szDescription, _st_APACHE_SERVICE::szDisplayName, _st_APACHE_SERVICE::szImagePath, _st_APACHE_SERVICE::szServiceName, and TRUE. Referenced by ServiceDlgProc(), and WndProc(). Here is the call graph for this function: ![]() |
|
|
Definition at line 249 of file ApacheMonitor.c. |
|
|
Definition at line 259 of file ApacheMonitor.c. References FALSE, OS_VERSION_WIN2K, OS_VERSION_WIN9X, OS_VERSION_WINNT, and TRUE. Referenced by CreateMainWindow(). |
|
||||||||||||||||
|
Definition at line 874 of file ApacheMonitor.c. References FALSE, g_bRescanServices, g_dwOSVersion, NULL, OS_VERSION_WIN9X, and TRUE. Referenced by FindRunningServices(). |
|
||||||||||||
|
Definition at line 635 of file ApacheMonitor.c. References BOOL, CloseHandle, FALSE, g_dwOSVersion, NULL, OS_VERSION_WIN9X, RunRedirectedConsole(), and TRUE. Referenced by ApacheManageService(). Here is the call graph for this function: ![]() |
|
|
Definition at line 568 of file ApacheMonitor.c. References BOOL, CloseHandle, ConsoleOutputThread(), ConsoleWaitingThread(), CreatePipe, CreateThread, DuplicateHandle, ErrorMessage(), FALSE, g_hpipeInRead, g_hpipeInWrite, g_hpipeOutRead, g_hpipeOutWrite, g_hpipeStdError, g_lpRedirectProc, GetCurrentProcess, MAX_PATH, NULL, and TRUE. Referenced by RunAndForgetConsole(). Here is the call graph for this function: ![]() |
|
||||||||||||||||||||
|
Definition at line 1136 of file ApacheMonitor.c. References addListBoxItem(), am_DisconnectComputer(), ApacheManageService(), CenterWindow(), ConnectDlgProc(), FALSE, g_bConsoleRun, g_dwOSVersion, g_hBmpOld, g_hBmpPicture, g_hBmpStart, g_hBmpStop, g_hCursorArrow, g_hCursorHourglass, g_hInstance, g_hwndMain, g_hwndServiceDlg, g_hwndStdoutList, g_lpMsg, g_szLocalHost, g_szTitle, GetApacheServicesStatus(), IDC_SCONNECT, IDC_SDISCONN, IDC_SEXIT, IDC_SMANAGER, IDC_SRESTART, IDC_SSTART, IDC_SSTOP, IDC_STATBAR, IDD_DLGCONNECT, IDL_SERVICES, IDL_STDOUT, IDM_EXIT, IDS_MSG_CONNECT, IDS_MSG_FIRST, IDS_MSG_MNUEXIT, IDS_MSG_SERVICES, IDS_MSG_SRESTART, IDS_MSG_SSTART, IDS_MSG_SSTOP, MAX_PATH, NULL, OS_VERSION_WIN2K, OS_VERSION_WINNT, SERVICE_APACHE_RESTART, _st_APACHE_SERVICE::szComputerName, _st_APACHE_SERVICE::szDescription, tm, TRUE, WM_MANAGEMESSAGE, WM_TIMER_RESCAN, WM_UPDATEMESSAGE, XBITMAP, y, and YBITMAP. Referenced by WndProc(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 300 of file ApacheMonitor.c. References g_icoRun, g_icoStop, g_lpMsg, IDS_MSG_FIRST, IDS_MSG_NOSERVICES, IDS_MSG_RUNNING, IDS_MSG_RUNNINGALL, IDS_MSG_RUNNINGNONE, n, nid, NULL, and WM_TRAYMESSAGE. Referenced by WndProc(). |
|
|
Definition at line 404 of file ApacheMonitor.c. References appendMenuItem(), FALSE, g_dwOSVersion, g_lpMsg, IDC_SMANAGER, IDM_EXIT, IDM_RESTORE, IDS_MSG_FIRST, IDS_MSG_MNUEXIT, IDS_MSG_MNUSERVICES, IDS_MSG_MNUSHOW, NULL, OS_VERSION_WINNT, and TRUE. Referenced by WndProc(). Here is the call graph for this function: ![]() |
|
|
Definition at line 436 of file ApacheMonitor.c. References appendServiceMenu(), and NULL. Referenced by WndProc(). Here is the call graph for this function: ![]() |
|
||||||||||||||||||||
|
Definition at line 1676 of file ApacheMonitor.c. References am_ClearComputersSt(), am_ClearServicesSt(), CloseHandle, CreateMainWindow(), ErrorMessage(), FALSE, g_bUiTaskbarCreated, g_hBmpStart, g_hBmpStop, g_hCursorArrow, g_hCursorHourglass, g_hInstance, g_hwndMain, g_hwndServiceDlg, g_icoRun, g_icoStop, g_LangID, g_lpMsg, g_stcSection, g_szLocalHost, g_szTitle, g_szWindowClass, _st_MONITORED_COMPUTERS::hRegistry, IDB_BMPRUN, IDB_BMPSTOP, IDI_ICORUN, IDI_ICOSTOP, IDS_APMONITORCLASS, IDS_APMONITORTITLE, IDS_MSG_APPRUNNING, IDS_MSG_FIRST, IDS_MSG_LAST, MAX_APACHE_COMPUTERS, MAX_APACHE_SERVICES, MAX_LOADSTRING, NULL, strdup(), _st_MONITORED_COMPUTERS::szComputerName, TRUE, XBITMAP, and YBITMAP. Here is the call graph for this function: ![]() |
|
||||||||||||||||||||
|
Definition at line 1454 of file ApacheMonitor.c. References ApacheManageService(), FALSE, FindRunningServices(), g_bDlgServiceOn, g_bRescanServices, g_bUiTaskbarCreated, g_dwOSVersion, g_hInstance, g_hwndServiceDlg, g_stcSection, GetApacheServicesStatus(), IDC_SMANAGER, IDD_DLGSERVICES, IDM_EXIT, IDM_RESTORE, IDM_SM_RESTART, IDM_SM_START, IDM_SM_STOP, NULL, OS_VERSION_WIN2K, REFRESH_TIME, RESCAN_TIME, SERVICE_APACHE_RESTART, ServiceDlgProc(), ShowNotifyIcon(), ShowTryPopupMenu(), ShowTryServicesMenu(), TRUE, WM_TIMER_REFRESH, WM_TIMER_RESCAN, WM_TRAYMESSAGE, and WM_UPDATEMESSAGE. Referenced by CreateMainWindow(). Here is the call graph for this function: ![]() |
|
|
Definition at line 88 of file ApacheMonitor.c. Referenced by ApacheManageService(), ConsoleWaitingThread(), and ServiceDlgProc(). |
|
|
Definition at line 87 of file ApacheMonitor.c. Referenced by addListBoxString(), and WndProc(). |
|
|
Definition at line 94 of file ApacheMonitor.c. Referenced by ApacheManageService(), GetApacheServicesStatus(), IsServiceRunning(), and WndProc(). |
|
|
Definition at line 85 of file ApacheMonitor.c. |
|
|
Definition at line 86 of file ApacheMonitor.c. Referenced by ApacheManageService(), CreateMainWindow(), IsServiceRunning(), RunAndForgetConsole(), ServiceDlgProc(), ShowTryPopupMenu(), and WndProc(). |
|
|
Definition at line 93 of file ApacheMonitor.c. Referenced by ServiceDlgProc(). |
|
|
Definition at line 93 of file ApacheMonitor.c. Referenced by ServiceDlgProc(). |
|
|
Definition at line 92 of file ApacheMonitor.c. Referenced by appendServiceMenu(), ServiceDlgProc(), and WinMain(). |
|
|
Definition at line 92 of file ApacheMonitor.c. Referenced by appendServiceMenu(), ServiceDlgProc(), and WinMain(). |
|
|
Definition at line 100 of file ApacheMonitor.c. Referenced by ApacheManageService(), ConsoleWaitingThread(), CreateMainWindow(), ServiceDlgProc(), and WinMain(). |
|
|
Definition at line 99 of file ApacheMonitor.c. Referenced by ApacheManageService(), ServiceDlgProc(), and WinMain(). |
|
|
Definition at line 80 of file ApacheMonitor.c. Referenced by ServiceDlgProc(), WinMain(), and WndProc(). |
|
|
Definition at line 104 of file ApacheMonitor.c. Referenced by RunRedirectedConsole(). |
|
|
Definition at line 105 of file ApacheMonitor.c. Referenced by ConsoleOutputThread(), and RunRedirectedConsole(). |
|
|
Definition at line 102 of file ApacheMonitor.c. Referenced by ConsoleOutputThread(), and RunRedirectedConsole(). |
|
|
Definition at line 103 of file ApacheMonitor.c. Referenced by RunRedirectedConsole(). |
|
|
Definition at line 106 of file ApacheMonitor.c. Referenced by ConsoleOutputThread(), and RunRedirectedConsole(). |
|
|
Definition at line 98 of file ApacheMonitor.c. Referenced by ConnectDlgProc(). |
|
|
Definition at line 96 of file ApacheMonitor.c. Referenced by ConnectDlgProc(), ServiceDlgProc |