https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2284aa6e8bf5b38dbb5fe…
commit 2284aa6e8bf5b38dbb5fe8c6053cb7f01880a4de
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sat Feb 25 10:31:43 2023 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Sat Feb 25 10:31:43 2023 +0900
[COMDLG32] Follow-up of #5097 (f4bb0ae)
Do not change flags unless necessary.
https://bugs.winehq.org/show_bug.cgi?id=54567
CORE-17064
---
dll/win32/comdlg32/finddlg.c | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/dll/win32/comdlg32/finddlg.c b/dll/win32/comdlg32/finddlg.c
index fc13f8a7d54..459c4bdd0b2 100644
--- a/dll/win32/comdlg32/finddlg.c
+++ b/dll/win32/comdlg32/finddlg.c
@@ -89,9 +89,11 @@ static void COMDLG32_FR_HandleWMCommand(HWND hDlgWnd, COMDLG32_FR_Data
*pData, i
{
DWORD flag;
+#ifndef __REACTOS__
pData->user_fr.fra->Flags &= ~FR_MASK; /* Clear return flags */
if(pData->fr.Flags & FR_WINE_REPLACE) /* Replace always goes down... */
pData->user_fr.fra->Flags |= FR_DOWN;
+#endif
if(NotifyCode == BN_CLICKED)
{
@@ -100,6 +102,11 @@ static void COMDLG32_FR_HandleWMCommand(HWND hDlgWnd,
COMDLG32_FR_Data *pData, i
case IDOK: /* Find Next */
if(GetDlgItemTextA(hDlgWnd, edt1, pData->fr.lpstrFindWhat,
pData->fr.wFindWhatLen) > 0)
{
+#ifdef __REACTOS__
+ pData->user_fr.fra->Flags &= ~FR_MASK; /* Clear return flags */
+ if(pData->fr.Flags & FR_WINE_REPLACE) /* Replace always goes down... */
+ pData->user_fr.fra->Flags |= FR_DOWN;
+#endif
pData->user_fr.fra->Flags |= COMDLG32_FR_GetFlags(hDlgWnd) | FR_FINDNEXT;
if(pData->fr.Flags & FR_WINE_UNICODE)
{
@@ -116,6 +123,11 @@ static void COMDLG32_FR_HandleWMCommand(HWND hDlgWnd,
COMDLG32_FR_Data *pData, i
break;
case IDCANCEL:
+#ifdef __REACTOS__
+ pData->user_fr.fra->Flags &= ~FR_MASK; /* Clear return flags */
+ if(pData->fr.Flags & FR_WINE_REPLACE) /* Replace always goes down... */
+ pData->user_fr.fra->Flags |= FR_DOWN;
+#endif
pData->user_fr.fra->Flags |= COMDLG32_FR_GetFlags(hDlgWnd) | FR_DIALOGTERM;
SendMessageA(pData->fr.hwndOwner, FindReplaceMessage, 0,
(LPARAM)pData->user_fr.fra);
DestroyWindow(hDlgWnd);
@@ -133,6 +145,11 @@ Replace:
{
pData->fr.lpstrReplaceWith[0] = 0; /* In case the next GetDlgItemText Fails */
GetDlgItemTextA(hDlgWnd, edt2, pData->fr.lpstrReplaceWith,
pData->fr.wReplaceWithLen);
+#ifdef __REACTOS__
+ pData->user_fr.fra->Flags &= ~FR_MASK; /* Clear return flags */
+ if(pData->fr.Flags & FR_WINE_REPLACE) /* Replace always goes down... */
+ pData->user_fr.fra->Flags |= FR_DOWN;
+#endif
pData->user_fr.fra->Flags |= COMDLG32_FR_GetFlags(hDlgWnd) | flag;
if(pData->fr.Flags & FR_WINE_UNICODE)
{
@@ -153,6 +170,11 @@ Replace:
break;
case pshHelp:
+#ifdef __REACTOS__
+ pData->user_fr.fra->Flags &= ~FR_MASK; /* Clear return flags */
+ if(pData->fr.Flags & FR_WINE_REPLACE) /* Replace always goes down... */
+ pData->user_fr.fra->Flags |= FR_DOWN;
+#endif
pData->user_fr.fra->Flags |= COMDLG32_FR_GetFlags(hDlgWnd);
SendMessageA(pData->fr.hwndOwner, HelpMessage, (WPARAM)hDlgWnd,
(LPARAM)pData->user_fr.fra);
break;
@@ -168,12 +190,6 @@ Replace:
EnableWindow(GetDlgItem(hDlgWnd, psh2), enable);
}
}
-#ifdef __REACTOS__
- else if (NotifyCode == EN_KILLFOCUS && Id == edt1)
- {
- pData->user_fr.fra->Flags |= COMDLG32_FR_GetFlags(hDlgWnd);
- }
-#endif
}
/***********************************************************************