首先在创建时一定要增加SS_NOTIFY参数,这样可以为父窗口发送鼠标事件:
ctxt1[i].CreateEx(WS_EX_CLIENTEDGE,"STATIC",nam,WS_CHILD|WS_VISIBLE|SS_NOTIFY|SS_CENTER,CRect(x,y,width,height),this,Get_STATIC_ID(i));
一下为响应鼠标的左击事件:
void CManagmentDlg::OnParentNotify(UINT message, LPARAM lParam)
{CDialogEx::OnParentNotify(message, lParam);
// TODO: 在此处添加消息处理程序代码
int n;
int xPos = GET_X_LPARAM(lParam);
int yPos = GET_Y_LPARAM(lParam);
int count=0;
int idx = m_tab1.GetCurFocus();
char *str = Get_Index_Group(idx),*str3;
switch(message){
case WM_CR