??前幾天接到一個關于軟鍵盤(soft KeyBoard)的項目,到網上Google了一下,網上只有COnscreenKeyboardDlg這么個東東,可是在用的時候又有問題,大家對這個東東想必也很了解吧,當你想用它在窗體的Edit里面輸入東西的時候,卻總是不行,總是失去Focus,那個郁悶啊(無法形容)。搞了兩天半,現在公布解決方法(簡單的要死,暈):
??????1.在頭文件中(COnscreenKeyboardDlg.h)加入:
?????????afx_msg int OnMouseActivate( CWnd* pDesktopWnd, UINT nHitTest, UINT message );
??????2.在COnscreenKeyboardDlg.cpp中:
?????????BEGIN_MESSAGE_MAP(COnscreenKeyboardDlg, CDialog)
?????????....???//(保留原有函數映射)
?????????ON_WM_MOUSEACTIVATE()//加入
?????????END_MESSAGE_MAP()
??????3.在cpp中加入:????????
??????1.在頭文件中(COnscreenKeyboardDlg.h)加入:
?????????afx_msg int OnMouseActivate( CWnd* pDesktopWnd, UINT nHitTest, UINT message );
??????2.在COnscreenKeyboardDlg.cpp中:
?????????BEGIN_MESSAGE_MAP(COnscreenKeyboardDlg, CDialog)
?????????....???//(保留原有函數映射)
?????????ON_WM_MOUSEACTIVATE()//加入
?????????END_MESSAGE_MAP()
??????3.在cpp中加入:????????
????????????int COnscreenKeyboardDlg::OnMouseActivate( CWnd* pDesktopWnd, UINT nHitTest, UINT message )
????????????{
?????????????return MA_NOACTIVATE;
?????????????
????????????}
下載地址:http://www.shnenglu.com/Files/findingworld/OnscreenKeyboardDlg.rar