- Replace the check-marks in the protocol menu by radio-bullets because the user...
authorEric Kohl <eric.kohl@reactos.org>
Sun, 23 Nov 2008 13:34:15 +0000 (13:34 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 23 Nov 2008 13:34:15 +0000 (13:34 +0000)
- 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

15 files changed:
reactos/base/applications/mscutils/eventvwr/eventvwr.c
reactos/base/applications/mscutils/eventvwr/lang/bg-BG.rc
reactos/base/applications/mscutils/eventvwr/lang/de-DE.rc
reactos/base/applications/mscutils/eventvwr/lang/el-GR.rc
reactos/base/applications/mscutils/eventvwr/lang/en-US.rc
reactos/base/applications/mscutils/eventvwr/lang/es-ES.rc
reactos/base/applications/mscutils/eventvwr/lang/fr-FR.rc
reactos/base/applications/mscutils/eventvwr/lang/it-IT.rc
reactos/base/applications/mscutils/eventvwr/lang/ko-KR.rc
reactos/base/applications/mscutils/eventvwr/lang/no-NO.rc
reactos/base/applications/mscutils/eventvwr/lang/pl-PL.rc
reactos/base/applications/mscutils/eventvwr/lang/ru-RU.rc
reactos/base/applications/mscutils/eventvwr/lang/sk-SK.rc
reactos/base/applications/mscutils/eventvwr/lang/uk-UA.rc
reactos/base/applications/mscutils/eventvwr/resource.h

index 59a5047..102b42d 100644 (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
+                    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_SYSTEM:
-                    QueryEventMessages(lpComputerName,       // Use the local computer.
-                                       EVENT_SOURCE_SYSTEM); // The event log category
+                case ID_LOG_SECURITY:
+                    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_SECURITY:
-                    QueryEventMessages(lpComputerName,         // Use the local computer.
-                                       EVENT_SOURCE_SECURITY); // The event log category
+                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:
index 03df50b..c7ba488 100644 (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
index 4566bfa..19ed0b3 100644 (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
index ecc337a..614ae02 100644 (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
index 91d13eb..eb6d83a 100644 (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
index e517c97..e4cb333 100644 (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
index ded893d..04a895c 100644 (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
index 667a7b2..06522bf 100644 (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
index c10f9a1..c5b9ee6 100644 (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
index 47fe4b7..7458ee7 100644 (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
index 61297ef..cb4e747 100644 (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
index d38fc40..4c78a79 100644 (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
index a9ffd31..c4bc5c2 100644 (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
index 61cf307..1ae8ca5 100644 (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
index 28fd819..2ef55b4 100644 (file)
 #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
 #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