https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ecd51d99f46fe45271ed7a9595834a1ca0aec77f

commit ecd51d99f46fe45271ed7a9595834a1ca0aec77f
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Mon Dec 3 04:25:46 2018 +0900
Commit:     GitHub <[email protected]>
CommitDate: Mon Dec 3 04:25:46 2018 +0900

    [SHELL32] Don't show taskbar button of file property sheet (#1085)
    
    CORE-10481
---
 dll/win32/shell32/dialogs/fprop.cpp | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/dll/win32/shell32/dialogs/fprop.cpp 
b/dll/win32/shell32/dialogs/fprop.cpp
index 784d6ec505..9433883cfd 100644
--- a/dll/win32/shell32/dialogs/fprop.cpp
+++ b/dll/win32/shell32/dialogs/fprop.cpp
@@ -3,7 +3,7 @@
  *
  * Copyright 2005 Johannes Anderwald
  * Copyright 2012 Rafal Harabien
- * Copyright 2017 Katayama Hirofumi MZ
+ * Copyright 2017-2018 Katayama Hirofumi MZ
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -67,6 +67,17 @@ LoadPropSheetHandlers(LPCWSTR pwszPath, PROPSHEETHEADERW 
*pHeader, UINT cMaxPage
     return cPages;
 }
 
+// CStubWindow32 --- The owner window of file property sheets.
+// This window hides taskbar button of property sheet.
+class CStubWindow32 : public CWindowImpl<CStubWindow32>
+{
+public:
+    DECLARE_WND_CLASS_EX(_T("StubWindow32"), 0, COLOR_WINDOWTEXT)
+
+    BEGIN_MSG_MAP(CPaletteWindow)
+    END_MSG_MAP()
+};
+
 /*************************************************************************
  *
  * SH_ShowPropertiesDialog
@@ -104,10 +115,17 @@ SH_ShowPropertiesDialog(LPCWSTR pwszPath, LPCITEMIDLIST 
pidlFolder, PCUITEMID_CH
     if (PathIsRootW(wszPath))
         return SUCCEEDED(SH_ShowDriveProperties(wszPath, pidlFolder, apidl));
 
+    DWORD style = WS_DISABLED | WS_CLIPSIBLINGS | WS_CAPTION;
+    DWORD exstyle = WS_EX_WINDOWEDGE | WS_EX_APPWINDOW;
+    CStubWindow32 stub;
+    if (!stub.Create(NULL, NULL, NULL, style, exstyle))
+        return E_FAIL;
+
     /* Handle files and folders */
     PROPSHEETHEADERW Header;
     memset(&Header, 0x0, sizeof(PROPSHEETHEADERW));
     Header.dwSize = sizeof(PROPSHEETHEADERW);
+    Header.hwndParent = stub;
     Header.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE;
     Header.phpage = hppages;
     Header.pszCaption = PathFindFileNameW(wszPath);
@@ -142,6 +160,8 @@ SH_ShowPropertiesDialog(LPCWSTR pwszPath, LPCITEMIDLIST 
pidlFolder, PCUITEMID_CH
     if (pFileDefExt)
         pFileDefExt->Release();
 
+    stub.DestroyWindow();
+
     return (Result != -1);
 }
 

Reply via email to