summaryrefslogtreecommitdiffstats
path: root/support/win32/ApacheMonitor.c
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2001-08-17 00:14:00 +0200
committerWilliam A. Rowe Jr <wrowe@apache.org>2001-08-17 00:14:00 +0200
commit0ef3b7a3a4c9022d1c14416f944c602e576af4eb (patch)
tree2eba17bbe21460bbd2d2ceea98854c53bc95ef29 /support/win32/ApacheMonitor.c
parent Hush (diff)
downloadapache2-0ef3b7a3a4c9022d1c14416f944c602e576af4eb.tar.xz
apache2-0ef3b7a3a4c9022d1c14416f944c602e576af4eb.zip
Add the red light/green light to ApacheMonitor's popup menu.
[Mladen Turk <mturk@mappingsoft.com>] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90248 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--support/win32/ApacheMonitor.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/support/win32/ApacheMonitor.c b/support/win32/ApacheMonitor.c
index ed438fa474..c708832e47 100644
--- a/support/win32/ApacheMonitor.c
+++ b/support/win32/ApacheMonitor.c
@@ -304,11 +304,14 @@ void appendServiceMenu(HMENU hMenu, UINT uMenuId, LPSTR szServiceName, BOOL fRun
ZeroMemory(&mii, sizeof(MENUITEMINFO));
mii.cbSize = sizeof(MENUITEMINFO);
- mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_SUBMENU;
+ mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_SUBMENU | MIIM_CHECKMARKS;
mii.fType = MFT_STRING;
mii.wID = uMenuId;
+ mii.hbmpChecked = g_hBmpStart;
+ mii.hbmpUnchecked = g_hBmpStop;
mii.dwTypeData = szServiceName;
mii.hSubMenu = smh;
+ mii.fState = fRunning ? MFS_CHECKED : MFS_UNCHECKED;
InsertMenuItem(hMenu, IDM_SM_SERVICE + uMenuId, FALSE, &mii);
}
@@ -927,10 +930,6 @@ LRESULT CALLBACK ServiceDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
case WM_INITDIALOG:
ShowWindow(hDlg, SW_HIDE);
g_hwndServiceDlg = hDlg;
- g_hBmpStart = LoadImage(g_hInstance, MAKEINTRESOURCE(IDB_BMPRUN),
- IMAGE_BITMAP, XBITMAP, YBITMAP, LR_DEFAULTCOLOR);
- g_hBmpStop = LoadImage(g_hInstance, MAKEINTRESOURCE(IDB_BMPSTOP),
- IMAGE_BITMAP, XBITMAP, YBITMAP, LR_DEFAULTCOLOR);
Button_Enable(GetDlgItem(hDlg, IDC_SSTART), FALSE);
Button_Enable(GetDlgItem(hDlg, IDC_SSTOP), FALSE);
@@ -1164,10 +1163,6 @@ LRESULT CALLBACK ServiceDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
case WM_CLOSE:
EndDialog(hDlg, TRUE);
return TRUE;
- case WM_DESTROY:
- DeleteObject(g_hBmpStart);
- DeleteObject(g_hBmpStop);
- return TRUE;
default:
return FALSE;
}
@@ -1400,6 +1395,10 @@ int WINAPI WinMain(HINSTANCE hInstance,
LR_DEFAULTSIZE, LR_DEFAULTSIZE, LR_SHARED);
g_hCursorArrow = LoadImage(NULL, MAKEINTRESOURCE(OCR_NORMAL), IMAGE_CURSOR,
LR_DEFAULTSIZE, LR_DEFAULTSIZE, LR_SHARED);
+ g_hBmpStart = LoadImage(hInstance, MAKEINTRESOURCE(IDB_BMPRUN),
+ IMAGE_BITMAP, XBITMAP, YBITMAP, LR_DEFAULTCOLOR);
+ g_hBmpStop = LoadImage(hInstance, MAKEINTRESOURCE(IDB_BMPSTOP),
+ IMAGE_BITMAP, XBITMAP, YBITMAP, LR_DEFAULTCOLOR);
hMutex = CreateMutex(NULL, FALSE, "APSRVMON_MUTEX");
if((hMutex == NULL) || (GetLastError() == ERROR_ALREADY_EXISTS))
@@ -1432,5 +1431,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
DestroyIcon(g_icoRun);
DestroyCursor(g_hCursorHourglass);
DestroyCursor(g_hCursorArrow);
+ DeleteObject(g_hBmpStart);
+ DeleteObject(g_hBmpStop);
return 0;
}