https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a5aea8e537003654568ce0818dbeb07e3f8e4162
commit a5aea8e537003654568ce0818dbeb07e3f8e4162 Author: Katayama Hirofumi MZ <[email protected]> AuthorDate: Wed Feb 15 10:15:51 2023 +0900 Commit: GitHub <[email protected]> CommitDate: Wed Feb 15 10:15:51 2023 +0900 [NOTEPAD] Simplify NOTEPAD_EnableSearchMenu (#5077) --- base/applications/notepad/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base/applications/notepad/main.c b/base/applications/notepad/main.c index 42bf2493911..81908e303f2 100644 --- a/base/applications/notepad/main.c +++ b/base/applications/notepad/main.c @@ -33,10 +33,10 @@ static ATOM aFINDMSGSTRING; VOID NOTEPAD_EnableSearchMenu() { - EnableMenuItem(Globals.hMenu, CMD_SEARCH, - MF_BYCOMMAND | ((GetWindowTextLength(Globals.hEdit) == 0) ? MF_DISABLED | MF_GRAYED : MF_ENABLED)); - EnableMenuItem(Globals.hMenu, CMD_SEARCH_NEXT, - MF_BYCOMMAND | ((GetWindowTextLength(Globals.hEdit) == 0) ? MF_DISABLED | MF_GRAYED : MF_ENABLED)); + BOOL bEmpty = (GetWindowTextLengthW(Globals.hEdit) == 0); + UINT uEnable = MF_BYCOMMAND | (bEmpty ? MF_GRAYED : MF_ENABLED); + EnableMenuItem(Globals.hMenu, CMD_SEARCH, uEnable); + EnableMenuItem(Globals.hMenu, CMD_SEARCH_NEXT, uEnable); } /***********************************************************************
