Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
Z

zhangyoung

@zhangyoung
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Filter the EN_KILLFOCUS message from CIPAddressCtrl
    Z zhangyoung

    Thank you mat. You are right.I just call GetFocus and determine weather the EN_KILLFOCUS comes from the focused control.

    BOOL CMyDlg::OnCommand(WPARAM wParam, LPARAM lParam)
    {
    // TODO: Add your specialized code here and/or call the base class
    UINT notificationCode = (UINT)HIWORD(wParam);
    if (notificationCode == EN_KILLFOCUS || notificationCode == CBN_KILLFOCUS)
    {
    HWND hwnd = (HWND)lParam;
    if (hwnd == NULL)
    {
    return false;
    }
    CWnd* pWnd = CWnd::FromHandle(hwnd);
    int nID = pWnd->GetDlgCtrlID();
    if (GetFocus() != NULL && GetFocus()->m_hWnd == pWnd->m_hWnd) // Add this
    {
    return false;
    }
    GetParent()->PostMessage(UM_KILLFOCUS, nID, 0);
    }
    return CDialog::OnCommand(wParam, lParam);
    }

    C / C++ / MFC question

  • Filter the EN_KILLFOCUS message from CIPAddressCtrl
    Z zhangyoung

    You will get a EN_KILLFOCUS message,when the focus switch from CIPAddressCtrl to another control, and this is normal case. But when you click at the dots among four ip fields, you will get the EN_KILLFOCUS message too(with SPY++), which is not what I want, because I just want to do data validation when the CIPAddressCtrl lost focus. How can I filer the EN_KILLFOCUS message when I click the dots??? :doh:

    C / C++ / MFC question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups