From a41be43a2b01ad334f17f7daf0f30a1219ded225 Mon Sep 17 00:00:00 2001
From: Ilya Shpigor <shpigor@etersoft.ru>
Date: Fri, 15 May 2009 15:20:12 +0400
Subject: [PATCH 1/2] shell32: Add tab control for developers in the winver

---
 dlls/shell32/shell32_Ru.rc  |   23 ++++++++++++++---------
 dlls/shell32/shell32_main.c |   29 +++++++++++++++++++++++++++++
 dlls/shell32/shresdef.h     |    4 ++++
 3 files changed, 47 insertions(+), 9 deletions(-)

diff --git a/dlls/shell32/shell32_Ru.rc b/dlls/shell32/shell32_Ru.rc
index fa3d6ab..1ada546 100644
--- a/dlls/shell32/shell32_Ru.rc
+++ b/dlls/shell32/shell32_Ru.rc
@@ -167,18 +167,21 @@ FONT 10, "MS Shell Dlg"
 /*ICON "", stc1, 10, 10, 30, 30*/
 CONTROL "", IDC_ABOUT_LOGO_ETERSOFT, "Static", SS_BITMAP, 0, 0, 60, 60
 DEFPUSHBUTTON "OK", IDOK, 256, 194, 70, 16, WS_TABSTOP
-PUSHBUTTON "&Ëèöåíçèÿ Wine...", IDC_ABOUT_LICENSE, 152, 194, 70, 16, WS_TABSTOP
-PUSHBUTTON "&Ëèöåíçèÿ Etersoft", IDC_ABOUT_LICENSE_ETERSOFT, 152, 174, 70, 16, WS_TABSTOP
-LISTBOX IDC_ABOUT_LISTBOX, 8, 123, 137, 90, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
+PUSHBUTTON "&Ëèöåíçèÿ Wine...", IDC_ABOUT_LICENSE, 165, 194, 70, 16, WS_TABSTOP
+PUSHBUTTON "&Ëèöåíçèÿ Etersoft", IDC_ABOUT_LICENSE_ETERSOFT, 165, 174, 70, 16, WS_TABSTOP
+LISTBOX IDC_ABOUT_LISTBOX, 13, 123, 137, 87, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
+LISTBOX IDC_ABOUT_LISTETER, 13, 123, 137, 87, LBS_NOTIFY | WS_VSCROLL | WS_BORDER
 LTEXT "", IDC_ABOUT_STATIC_TEXT1, 35, 65, 137, 8
 LTEXT "Âåðñèÿ %s", IDC_ABOUT_STATIC_TEXT2, 35, 73, 290, 8
 LTEXT "%s", IDC_ABOUT_STATIC_PRODUCT, 35, 89, 290, 8
-LTEXT "%s", IDC_ABOUT_STATIC_OWNER, 153, 114, 174, 10
-LTEXT "%s", IDC_ABOUT_STATIC_RESPONSIBLE, 153, 126, 174, 10
-LTEXT "%s", IDC_ABOUT_STATIC_REGNUM, 153, 138, 174, 10
-LTEXT "", IDC_ABOUT_STATIC_TEXT3, 153, 150, 137, 8
-LTEXT "", IDC_ABOUT_STATIC_LINK, 153, 158, 160, 8, SS_NOTIFY
-LTEXT "Ðàçðàáîò÷èêè Wine:", IDC_ABOUT_WINE_TEXT, 8, 114, 137, 8
+LTEXT "%s", IDC_ABOUT_STATIC_OWNER, 163, 114, 174, 10
+LTEXT "%s", IDC_ABOUT_STATIC_RESPONSIBLE, 163, 126, 174, 10
+LTEXT "%s", IDC_ABOUT_STATIC_REGNUM, 163, 138, 174, 10
+LTEXT "", IDC_ABOUT_STATIC_TEXT3, 163, 150, 137, 8
+LTEXT "", IDC_ABOUT_STATIC_LINK, 163, 158, 160, 8, SS_NOTIFY
+/*LTEXT "Ðàçðàáîò÷èêè Wine:", IDC_ABOUT_WINE_TEXT, 8, 114, 137, 8*/
+LTEXT "", IDC_ABOUT_WINE_TEXT, 8, 107, 147, 1
+CONTROL "", IDC_ABOUT_TABDVL, "SysTabControl32", 0x0, 8, 108, 147, 102
 }
 
 SHELL_RUN_DLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
@@ -296,6 +299,8 @@ STRINGTABLE
 
 STRINGTABLE
 {
+IDS_ABOUT_WINEDVL,           "Ðàçðàáîò÷èêè Wine"
+IDS_ABOUT_ETERDVL,           "Etersoft"
 IDS_LICENSE_CHECKING,           "Ïðîâåðêà ïîäëèííîñòè äîñòóïíà íà ñòðàíèöå"
 IDS_LICENSE_ORGANIZATION,       "Îðãàíèçàöèÿ"
 IDS_LICENSE_PERSON,             "Îòâ. ëèöî"
diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c
index 8ba1631..d1a475d 100644
--- a/dlls/shell32/shell32_main.c
+++ b/dlls/shell32/shell32_main.c
@@ -1020,6 +1020,7 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
             DWORD dwBytesRead=0, dwFileSize=0;
             char buf[1024];
             char fn[1024];
+            TCITEMW item;
 
             if (info)
             {
@@ -1055,6 +1056,15 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
                 }
                 close(hFile);
 
+                item.mask = TCIF_TEXT;
+
+                if (LoadStringW( GetModuleHandleA("shell32.dll"), IDS_ABOUT_WINEDVL, loadstr, 512 ))
+                    item.pszText = loadstr;
+                TabCtrl_InsertItemW( GetDlgItem(hWnd, IDC_ABOUT_TABDVL), 0, &item );
+
+                if (LoadStringW( GetModuleHandleA("shell32.dll"), IDS_ABOUT_ETERDVL, loadstr, 512 ))
+                    item.pszText = loadstr;
+                TabCtrl_InsertItemW( GetDlgItem(hWnd, IDC_ABOUT_TABDVL), 1, &item );
 
                 LOADETER_FUNC(etersoft_getlicense);
                 LOADETER_FUNC(etersoft_getversion);
@@ -1125,6 +1135,7 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
                 SendMessageW( GetDlgItem(hWnd,IDC_ABOUT_STATIC_LINK), WM_SETFONT, (WPARAM)hFont,1);
                 SetWindowTextW( GetDlgItem(hWnd, IDC_ABOUT_STATIC_LINK), url );
 
+                ShowWindow( GetDlgItem(hWnd, IDC_ABOUT_LISTETER), SW_HIDE );
                 hWndCtl = GetDlgItem(hWnd, IDC_ABOUT_LISTBOX);
                 SendMessageW( hWndCtl, WM_SETREDRAW, 0, 0 );
                 SendMessageW( hWndCtl, WM_SETFONT, (WPARAM)info->hFont, 0 );
@@ -1178,6 +1189,24 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
         }
     break;
 
+    case WM_NOTIFY:
+        switch (((LPNMHDR)lParam)->code)
+        {
+        case (TCN_SELCHANGE):
+            if (TabCtrl_GetCurSel(GetDlgItem( hWnd, IDC_ABOUT_TABDVL )))
+            {
+                ShowWindow( GetDlgItem( hWnd, IDC_ABOUT_LISTBOX ), SW_HIDE );
+                ShowWindow( GetDlgItem( hWnd, IDC_ABOUT_LISTETER ), SW_SHOW );
+            }
+            else
+            {
+                ShowWindow( GetDlgItem( hWnd, IDC_ABOUT_LISTETER ), SW_HIDE );
+                ShowWindow( GetDlgItem( hWnd, IDC_ABOUT_LISTBOX ), SW_SHOW );
+            }
+            break;
+        }
+        break;
+
     case WM_COMMAND:
         if (wParam == IDOK || wParam == IDCANCEL)
         {
diff --git a/dlls/shell32/shresdef.h b/dlls/shell32/shresdef.h
index a67bce4..6096325 100644
--- a/dlls/shell32/shresdef.h
+++ b/dlls/shell32/shresdef.h
@@ -114,6 +114,8 @@
 #define IDS_LICENSE_REGNUM          255
 #define IDS_LICENSE                 256
 #define IDS_LICENSE_CAPTION         257
+#define IDS_ABOUT_WINEDVL           258
+#define IDS_ABOUT_ETERDVL           259
 
 #define MENU_SHV_FILE 144
 
@@ -198,6 +200,8 @@ FIXME: Need to add them, but for now just let them use the same: searching.avi
 #define IDC_ABOUT_STATIC_LINK 107
 #define IDC_ABOUT_LOGO_ETERSOFT 108
 #define IDC_ABOUT_STATIC_PRODUCT   109
+#define IDC_ABOUT_TABDVL        110
+#define IDC_ABOUT_LISTETER      111
 
 /* run dialog */
 #define IDC_RUNDLG_DESCRIPTION  12289
-- 
1.6.2.5

