From 5b7f03cf9f87cb3a1d1237db088256bd68436f40 Mon Sep 17 00:00:00 2001
From: Pavel Roskin <proski@gnu.org>
Date: Thu, 2 Oct 2003 04:26:53 +0000
Subject: [PATCH] Ignore window caption from PROPSHEETHEADER in wizards. 
 Update window caption when changing pages.

---
 dlls/comctl32/propsheet.c | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c
index c1a5f6065a6..04ea6750d2c 100644
--- a/dlls/comctl32/propsheet.c
+++ b/dlls/comctl32/propsheet.c
@@ -305,12 +305,17 @@ static BOOL PROPSHEET_CollectSheetInfoA(LPCPROPSHEETHEADERA lppsh,
 
   PROPSHEET_UnImplementedFlags(lppsh->dwFlags);
 
-  if (HIWORD(lppsh->pszCaption))
+  if (lppsh->dwFlags & INTRNL_ANY_WIZARD)
+     psInfo->ppshheader.pszCaption = NULL;
+  else
   {
-     int len = strlen(lppsh->pszCaption);
-     psInfo->ppshheader.pszCaption = HeapAlloc( GetProcessHeap(), 0, (len+1)*sizeof (WCHAR) );
-     MultiByteToWideChar(CP_ACP, 0, lppsh->pszCaption, -1, (LPWSTR) psInfo->ppshheader.pszCaption, len+1);
-     /* strcpy( (char *)psInfo->ppshheader.pszCaption, lppsh->pszCaption ); */
+     if (HIWORD(lppsh->pszCaption))
+     {
+        int len = strlen(lppsh->pszCaption);
+        psInfo->ppshheader.pszCaption = HeapAlloc( GetProcessHeap(), 0, (len+1)*sizeof (WCHAR) );
+        MultiByteToWideChar(CP_ACP, 0, lppsh->pszCaption, -1, (LPWSTR) psInfo->ppshheader.pszCaption, len+1);
+        /* strcpy( (char *)psInfo->ppshheader.pszCaption, lppsh->pszCaption ); */
+     }
   }
   psInfo->nPages = lppsh->nPages;
 
@@ -355,11 +360,16 @@ static BOOL PROPSHEET_CollectSheetInfoW(LPCPROPSHEETHEADERW lppsh,
 
   PROPSHEET_UnImplementedFlags(lppsh->dwFlags);
 
-  if (HIWORD(lppsh->pszCaption))
+  if (lppsh->dwFlags & INTRNL_ANY_WIZARD)
+     psInfo->ppshheader.pszCaption = NULL;
+  else
   {
-     int len = strlenW(lppsh->pszCaption);
-     psInfo->ppshheader.pszCaption = HeapAlloc( GetProcessHeap(), 0, (len+1)*sizeof(WCHAR) );
-     strcpyW( (WCHAR *)psInfo->ppshheader.pszCaption, lppsh->pszCaption );
+     if (!(lppsh->dwFlags & INTRNL_ANY_WIZARD) && HIWORD(lppsh->pszCaption))
+     {
+        int len = strlenW(lppsh->pszCaption);
+        psInfo->ppshheader.pszCaption = HeapAlloc( GetProcessHeap(), 0, (len+1)*sizeof(WCHAR) );
+        strcpyW( (WCHAR *)psInfo->ppshheader.pszCaption, lppsh->pszCaption );
+     }
   }
   psInfo->nPages = lppsh->nPages;
 
@@ -1554,6 +1564,9 @@ static BOOL PROPSHEET_ShowPage(HWND hwndDlg, int index, PropSheetInfo * psInfo)
      PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppshpage);
   }
 
+  PROPSHEET_SetTitleW(hwndDlg, psInfo->ppshheader.dwFlags,
+                      psInfo->proppage[index].pszText);
+
   if (psInfo->active_page != -1)
      ShowWindow(psInfo->proppage[psInfo->active_page].hwndPage, SW_HIDE);
 
-- 
GitLab