如题,自己做了一个 MFC 的ActiveX,有显示内容,c#调用,嵌入到一个Panel中,然后Panel又嵌入到一个Form中,目前的问题是,在鼠标单击我的控件时,包含控件的Form不能自动被激活,位于最前端显示。请问各位有什么好办法?我个人在OnLButtonDown里调用SetFocus 没作用,调用OnParentNotify也没作用,修改无窗口激活标志无作用,着急在线等mfcc#父窗体激活
调试欢乐多
获取正确父窗口了再做其他操作.
{
HWND hwndParent = 0; // Get the window associated with the in-place site object,
// which is connected to this ActiveX control.
if (m_pInPlaceSite != NULL)
m_pInPlaceSite->GetWindow(&hwndParent); return hwndParent; // Return the in-place site window handle.
}
按照这个获取了正确的窗体,然后设置其SetFocus,还是不行啊