Posted on 2006-06-26 16:36
小蘇 閱讀(968)
評(píng)論(4) 編輯 收藏 引用 所屬分類:
控件開發(fā)
??????前幾天接到一個(gè)關(guān)于軟鍵盤(soft KeyBoard)的項(xiàng)目,到網(wǎng)上Google了一下,網(wǎng)上只有COnscreenKeyboardDlg這么個(gè)東東,可是在用的時(shí)候又有問題,大家對(duì)這個(gè)東東想必也很了解吧,當(dāng)你想用它在窗體的Edit里面輸入東西的時(shí)候,卻總是不行,總是失去Focus,那個(gè)郁悶啊(無法形容)。搞了兩天半,現(xiàn)在公布解決方法(簡(jiǎn)單的要死,暈):
??????1.在頭文件中(COnscreenKeyboardDlg.h)加入:
?????????afx_msg int OnMouseActivate( CWnd* pDesktopWnd, UINT nHitTest, UINT message );
??????2.在COnscreenKeyboardDlg.cpp中:
?????????BEGIN_MESSAGE_MAP(COnscreenKeyboardDlg, CDialog)
?????????....???//(保留原有函數(shù)映射)
?????????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