代码如下:
获取主窗体
IntPtr pHandle =
new IntPtr(m_Hookhelper.ActiveView.ScreenDisplay.hWnd);
Form MainForm = System.Windows.Forms.Form.FromHandle(pHandle).FindForm();
同样的道理,也可以获得AxMapControl
IntPtr pHandle =
new IntPtr(m_hookHelper.ActiveView.ScreenDisplay.hWnd);
ESRI.ArcGIS.Controls.AxMapControl axMapControl = System.Windows.Forms.Form.FromHandle(pHandle) as ESRI.ArcGIS.Controls.AxMapControl;
http://hi.baidu.com/angela1906/item/a318f5580cb4d507e6c4a5c0