请教,我在ATL写的IE Bar插件中的ComboBox框无法下拉,而且也无法输入中文,这是什么原因?具体情况是IE ToolBar上有一个ComboBox框,但是无法点击下压按钮并且没有出现下拉框, 也无法输入中文只能输入英文,但是在程序中用SetWindowText却能正确输入中文,实在没则,求教,求教!
解决方案 »
- cxImage Draw
- 奇怪,同一段程序,运行次数越多耗时就越多,高手请进
- CListCtrl 问题
- 在认证过程中,与服务器交换看到“//接收挑战串”这个词汇,挑战串啥意思?
- 我要用程序控制鼠标在菜单及对话框中移动并单击,这时不想让用移动鼠标,如何做到?
- 关于office在"开始-〉程序"中的快捷方式,缺少目标文件,如何在程序中运行。
- 怎么新建一个文件夹?
- 请教一个捕捉鼠标所指控件ID或控件文本的问题
- 在VS2010下,用MSCom做的一个串口通信,为什么接收的数据不能在显示框显示?
- CListView成员create窗口后,退出程序时报错
- 谁见过类似的问题??
- 如何实现Edit只显示大写字符??
class CEditQuote : public CWindowImpl<CEditQuote>
{
public:
DECLARE_WND_SUPERCLASS(TEXT("Caoy_Test"), TEXT("COMBOBOX")) BEGIN_MSG_MAP(CEditQuote)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_SHOWWINDOW, OnShow)
COMMAND_CODE_HANDLER(EN_SETFOCUS, OnSetFocus)
COMMAND_CODE_HANDLER(CBN_DROPDOWN, OnDropDown)
COMMAND_CODE_HANDLER(CBN_EDITCHANGE, OnEditChange)
ALT_MSG_MAP(1)
MESSAGE_HANDLER(WM_CHAR, OnChar);
END_MSG_MAP() LRESULT OnSetFocus(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); CEditQuote();
virtual ~CEditQuote();
STDMETHOD(TranslateAcceleratorIO)(THIS_ LPMSG lpMsg);
void SetBand(CStockBar* pBand);
CContainedWindow m_EditCtrl;
private:
CStockBar* m_pBand;
LRESULT OnChar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnDropDown(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnEditChange(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
};
其中 CContainedWindow m_EditCtrl;是用于子类化ComboBox中被复合的EDIT标准控件.
改为
COMMAND_CODE_HANDLER(CBN_SETFOCUS, OnSetFocus)
{
// based on the size of the window area minus the size of the toolbar button,
// indent the toolbar so that we can place the edit box before the toolbar
// button. This will right justify the toolbar button in the toolbar and the
// edit box will use the vaction space to the left of the button but after the
// toolbar text as it's usable space.
RECT wndRect, btnRect;
GetClientRect(&wndRect);
::SendMessage(m_hWnd, TB_GETITEMRECT, 0, (LPARAM)&btnRect);
wndRect.right -= (btnRect.right - btnRect.left);
wndRect.bottom += 100;
SendMessage(TB_SETINDENT, wndRect.right - wndRect.left);
// put a small spacing gap between the edit box's right edge and the toolbar button's left edge
wndRect.right -= 3;
m_EditWnd.MoveWindow(&wndRect, FALSE);
return 0;
}