[NOTEPAD] Simplify NOTEPAD_EnableSearchMenu (#5077)

This commit is contained in:
Katayama Hirofumi MZ 2023-02-15 10:15:51 +09:00 committed by GitHub
parent efb923073c
commit a5aea8e537
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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);
}
/***********************************************************************