- Replace the check-marks in the protocol menu by radio-bullets because the user can only select one of three protocols.

- Mark a protocol in the menu only if it was read correctly. Otherwise the security protocol gets selected although the user is not able to see this protocol.
- Minor clean-up of the resource id mess.

svn path=/trunk/; revision=37586
This commit is contained in:
Eric Kohl 2008-11-23 13:34:15 +00:00
parent d801a49d71
commit 8811ad12d4
15 changed files with 68 additions and 56 deletions

View file

@ -486,7 +486,7 @@ ShowStatusMessageThread(IN LPVOID lpParameter)
}
VOID
BOOL
QueryEventMessages(LPTSTR lpMachineName,
LPTSTR lpLogName)
{
@ -529,7 +529,7 @@ QueryEventMessages(LPTSTR lpMachineName,
_TEXT("Could not open the event log."),
_TEXT("Event Log"),
MB_OK | MB_ICONINFORMATION);
return;
return FALSE;
}
// Disable listview redraw
@ -686,6 +686,8 @@ QueryEventMessages(LPTSTR lpMachineName,
// Close the event log.
CloseEventLog(hEventLog);
return TRUE;
}
@ -870,13 +872,19 @@ InitInstance(HINSTANCE hInstance,
LRESULT CALLBACK
WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
RECT rect;
NMHDR *hdr;
HMENU hMenu;
switch (message)
{
case WM_CREATE:
CheckMenuRadioItem(GetMenu(hWnd),
ID_LOG_APPLICATION,
ID_LOG_SYSTEM,
ID_LOG_APPLICATION,
MF_BYCOMMAND);
break;
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code)
{
@ -888,7 +896,10 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if (lpnmitem->iItem != -1)
{
DialogBox(hInst, MAKEINTRESOURCE(IDD_EVENTDETAILDIALOG), hWnd, EventDetails);
DialogBox(hInst,
MAKEINTRESOURCE(IDD_EVENTDETAILDIALOG),
hWnd,
EventDetails);
}
}
break;
@ -896,41 +907,43 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
if ((wmId == ID_LOG_APPLICATION) ||
(wmId == ID_LOG_SYSTEM) ||
(wmId == ID_LOG_SECURITY))
{
hMenu = GetMenu(hWnd); // get the menu handle. Use it below
CheckMenuItem(hMenu, ID_LOG_APPLICATION, MF_UNCHECKED);
CheckMenuItem(hMenu, ID_LOG_SYSTEM, MF_UNCHECKED);
CheckMenuItem (hMenu, ID_LOG_SECURITY, MF_UNCHECKED);
if (hMenu)
{
CheckMenuItem(hMenu, wmId, MF_CHECKED);
}
}
// Parse the menu selections:
switch (wmId)
switch (LOWORD(wParam))
{
case ID_LOG_APPLICATION:
QueryEventMessages(lpComputerName, // Use the local computer.
EVENT_SOURCE_APPLICATION); // The event log category
break;
case ID_LOG_SYSTEM:
QueryEventMessages(lpComputerName, // Use the local computer.
EVENT_SOURCE_SYSTEM); // The event log category
if (QueryEventMessages(lpComputerName, // Use the local computer.
EVENT_SOURCE_APPLICATION)) // The event log category
{
CheckMenuRadioItem(GetMenu(hWnd),
ID_LOG_APPLICATION,
ID_LOG_SYSTEM,
ID_LOG_APPLICATION,
MF_BYCOMMAND);
}
break;
case ID_LOG_SECURITY:
QueryEventMessages(lpComputerName, // Use the local computer.
EVENT_SOURCE_SECURITY); // The event log category
if (QueryEventMessages(lpComputerName, // Use the local computer.
EVENT_SOURCE_SECURITY)) // The event log category
{
CheckMenuRadioItem(GetMenu(hWnd),
ID_LOG_APPLICATION,
ID_LOG_SYSTEM,
ID_LOG_SECURITY,
MF_BYCOMMAND);
}
break;
case ID_LOG_SYSTEM:
if (QueryEventMessages(lpComputerName, // Use the local computer.
EVENT_SOURCE_SYSTEM)) // The event log category
{
CheckMenuRadioItem(GetMenu(hWnd),
ID_LOG_APPLICATION,
ID_LOG_SYSTEM,
ID_LOG_SYSTEM,
MF_BYCOMMAND);
}
break;
case IDM_REFRESH:

View file

@ -4,7 +4,7 @@ IDC_EVENTVWR MENU
BEGIN
POPUP "&Äíåâíèê"
BEGIN
MENUITEM "&Ïðèëîæåíèå", ID_LOG_APPLICATION, CHECKED
MENUITEM "&Ïðèëîæåíèå", ID_LOG_APPLICATION
MENUITEM "&Ñèãóðíîñò", ID_LOG_SECURITY
MENUITEM "&Óðåäáà", ID_LOG_SYSTEM
MENUITEM SEPARATOR

View file

@ -12,7 +12,7 @@ IDC_EVENTVWR MENU
BEGIN
POPUP "&Protokoll"
BEGIN
MENUITEM "&Anwendung", ID_LOG_APPLICATION, CHECKED
MENUITEM "&Anwendung", ID_LOG_APPLICATION
MENUITEM "&Sicherheit", ID_LOG_SECURITY
MENUITEM "&System", ID_LOG_SYSTEM
MENUITEM SEPARATOR

View file

@ -12,7 +12,7 @@ IDC_EVENTVWR MENU
BEGIN
POPUP "&Log"
BEGIN
MENUITEM "&ÅöáñìïãÞ", ID_LOG_APPLICATION, CHECKED
MENUITEM "&ÅöáñìïãÞ", ID_LOG_APPLICATION
MENUITEM "&ÁóöÜëåéá", ID_LOG_SECURITY
MENUITEM "&Óýóôçìá", ID_LOG_SYSTEM
MENUITEM SEPARATOR

View file

@ -12,7 +12,7 @@ IDC_EVENTVWR MENU
BEGIN
POPUP "&Log"
BEGIN
MENUITEM "&Application", ID_LOG_APPLICATION, CHECKED
MENUITEM "&Application", ID_LOG_APPLICATION
MENUITEM "&Security", ID_LOG_SECURITY
MENUITEM "&System", ID_LOG_SYSTEM
MENUITEM SEPARATOR

View file

@ -12,7 +12,7 @@ IDC_EVENTVWR MENU
BEGIN
POPUP "&Log"
BEGIN
MENUITEM "&Aplicación", ID_LOG_APPLICATION, CHECKED
MENUITEM "&Aplicación", ID_LOG_APPLICATION
MENUITEM "&Seguridad", ID_LOG_SECURITY
MENUITEM "&Sistema", ID_LOG_SYSTEM
MENUITEM SEPARATOR

View file

@ -12,7 +12,7 @@ IDC_EVENTVWR MENU
BEGIN
POPUP "Journa&l"
BEGIN
MENUITEM "&Application", ID_LOG_APPLICATION, CHECKED
MENUITEM "&Application", ID_LOG_APPLICATION
MENUITEM "&Sécurité", ID_LOG_SECURITY
MENUITEM "&Système", ID_LOG_SYSTEM
MENUITEM SEPARATOR

View file

@ -12,7 +12,7 @@ IDC_EVENTVWR MENU
BEGIN
POPUP "&Log"
BEGIN
MENUITEM "&Applicazioni", ID_LOG_APPLICATION, CHECKED
MENUITEM "&Applicazioni", ID_LOG_APPLICATION
MENUITEM "&Sicurezza", ID_LOG_SECURITY
MENUITEM "&Sistema", ID_LOG_SYSTEM
MENUITEM SEPARATOR

View file

@ -8,7 +8,7 @@ IDC_EVENTVWR MENU
BEGIN
POPUP "로그(&L)"
BEGIN
MENUITEM "애플리케이션(&A)", ID_LOG_APPLICATION, CHECKED
MENUITEM "애플리케이션(&A)", ID_LOG_APPLICATION
MENUITEM "보안(&S)", ID_LOG_SECURITY
MENUITEM "시스템(&S)", ID_LOG_SYSTEM
MENUITEM SEPARATOR

View file

@ -12,7 +12,7 @@ IDC_EVENTVWR MENU
BEGIN
POPUP "&Logg"
BEGIN
MENUITEM "&Applikasjon", ID_LOG_APPLICATION, CHECKED
MENUITEM "&Applikasjon", ID_LOG_APPLICATION
MENUITEM "&Sikkerhet", ID_LOG_SECURITY
MENUITEM "&System", ID_LOG_SYSTEM
MENUITEM SEPARATOR

View file

@ -16,7 +16,7 @@ IDC_EVENTVWR MENU
BEGIN
POPUP "&Logi"
BEGIN
MENUITEM "&Aplikacja", ID_LOG_APPLICATION, CHECKED
MENUITEM "&Aplikacja", ID_LOG_APPLICATION
MENUITEM "&Zabezpieczenia", ID_LOG_SECURITY
MENUITEM "&System", ID_LOG_SYSTEM
MENUITEM SEPARATOR

View file

@ -12,7 +12,7 @@ IDC_EVENTVWR MENU
BEGIN
POPUP "&Ëîãè"
BEGIN
MENUITEM "&Ïðèëîæåíèé", ID_LOG_APPLICATION, CHECKED
MENUITEM "&Ïðèëîæåíèé", ID_LOG_APPLICATION
MENUITEM "&Áåçîïàñíîñòè", ID_LOG_SECURITY
MENUITEM "&Ñèñòåìû", ID_LOG_SYSTEM
MENUITEM SEPARATOR

View file

@ -9,7 +9,7 @@ IDC_EVENTVWR MENU
BEGIN
POPUP "&Záznam"
BEGIN
MENUITEM "&Application", ID_LOG_APPLICATION, CHECKED
MENUITEM "&Application", ID_LOG_APPLICATION
MENUITEM "&Security", ID_LOG_SECURITY
MENUITEM "&System", ID_LOG_SYSTEM
MENUITEM SEPARATOR

View file

@ -12,7 +12,7 @@ IDC_EVENTVWR MENU
BEGIN
POPUP "&Çâ³ò"
BEGIN
MENUITEM "&Ïðîãðàìà", ID_LOG_APPLICATION, CHECKED
MENUITEM "&Ïðîãðàìà", ID_LOG_APPLICATION
MENUITEM "&Çàõèñò", ID_LOG_SECURITY
MENUITEM "&Ñèñòåìà", ID_LOG_SYSTEM
MENUITEM SEPARATOR

View file

@ -15,13 +15,13 @@
#define IDC_EVENTVWR 109
#define IDC_EVENTSTRINGIDNOTFOUND 209
#define IDC_PROCESSPROGRESS 250
#define IDC_EVENTLOG_ERROR_TYPE 251
#define IDC_EVENTLOG_WARNING_TYPE 252
#define IDC_EVENTLOG_INFORMATION_TYPE 253
#define IDC_EVENTLOG_AUDIT_SUCCESS 254
#define IDC_EVENTLOG_AUDIT_FAILURE 255
#define IDC_EVENTLOG_SUCCESS 256
#define IDC_EVENTLOG_UNKNOWN_TYPE 257
#define IDC_EVENTLOG_ERROR_TYPE 251
#define IDC_EVENTLOG_WARNING_TYPE 252
#define IDC_EVENTLOG_INFORMATION_TYPE 253
#define IDC_EVENTLOG_AUDIT_SUCCESS 254
#define IDC_EVENTLOG_AUDIT_FAILURE 255
#define IDC_EVENTLOG_SUCCESS 256
#define IDC_EVENTLOG_UNKNOWN_TYPE 257
#define IDR_MAINFRAME 128
#define IDI_WARNINGICON 129
#define IDI_INFORMATIONICON 130
@ -41,10 +41,9 @@
#define IDC_BYTESRADIO 1011
#define IDC_WORDRADIO 1013
#define IDC_EVENTDATAEDIT 1014
#define ID_LOG_APLICATION 32771
#define ID_LOG_APPLICATION 32771
#define ID_LOG_SECURITY 32772
#define ID_LOG_SYSTEM 32773
#define ID_LOG_APPLICATION 32774
#define ID_HELP_HELP 32775
#define ID_HELP 32776
#define ID_OPTIONS 32777