Thanks guys for your help. I also found another way to do this.
Is to call the
GetClassName
Function:
int WINAPI GetClassName(
__in HWND hWnd,
__out LPTSTR lpClassName,
__in int nMaxCount
);
& then compare the returned
lpClassName with
_T("Edit"), so if they are the same, then an Edit Box Control is getting the focus.
TCHAR szClassName[32];
GetClassName(GetFocus()->GetSafeHwnd(), szClassName, sizeof(szClassName));
if (!lstrcmpi(szClassName, _T("Edit")))
NB: The purpose for this code is to
Enable the (Undo, Cut, Copy & Paste) buttons from the main menu & the main toolbar if an Edit Box control has gain the focus &
Disable them if no Edit Box control is currently having the focus.