F
farseer
Hi,
i have today app that displays a text box. The code below is called
from the WndProc handler when a WM_LBUTTONDOWN message is detected. On
the first pass, it works fine. That is, when i scroll down to my today
item from the today scree, then click the dpad center key, SendMessage
with a WM_SETFOCUS is called to set the focus to my edit control.
HOWEVER, i have come to realize that GetFocus always returns the handle
of the DesktopExplorer and NOT my edit control, even though it has the
focus. Why is this and how can i determine whether my edit control
has the input focus?
void MyTodayApp::OnLButtonUp(UINT nFlags, POINT point)
{
HWND focusCtl = GetFocus( );
int textLen = SendMessage( m_hEditBox, WM_GETTEXTLENGTH, 0 , 0 );
if ( ( focusCtl != m_hEditBox ) )
SendMessage( m_hEditBox, WM_SETFOCUS, 0, 0 );
else if ( textLen > 0 )
MessageBox(NULL, TEXT("Submitting data"), TEXT("Submitting data:"),
MB_OK);
}
i have today app that displays a text box. The code below is called
from the WndProc handler when a WM_LBUTTONDOWN message is detected. On
the first pass, it works fine. That is, when i scroll down to my today
item from the today scree, then click the dpad center key, SendMessage
with a WM_SETFOCUS is called to set the focus to my edit control.
HOWEVER, i have come to realize that GetFocus always returns the handle
of the DesktopExplorer and NOT my edit control, even though it has the
focus. Why is this and how can i determine whether my edit control
has the input focus?
void MyTodayApp::OnLButtonUp(UINT nFlags, POINT point)
{
HWND focusCtl = GetFocus( );
int textLen = SendMessage( m_hEditBox, WM_GETTEXTLENGTH, 0 , 0 );
if ( ( focusCtl != m_hEditBox ) )
SendMessage( m_hEditBox, WM_SETFOCUS, 0, 0 );
else if ( textLen > 0 )
MessageBox(NULL, TEXT("Submitting data"), TEXT("Submitting data:"),
MB_OK);
}