thanks Tony, i hadn't tried 'DisplayContextMenu' and was a little worried that i may have over looked it. I couldn't find 'DisplayContextMenu' in the objectbrowser, but then i checked a later version of acmgd.dll (i'm using A2008) and found it there.
I've been looking through acad.exe using dependacy walker and found ?DisplayPopupPaneMenu@AcPane@@UAEIAAVCMenu@@@Z and also ?DisplayContextMenu@AcStatusBarItem@@UAEIAAVCMenu@@VCPoint@@@Z.
as my c++ is limited to almost no experience, i'm now having trouble using the right arguments for the pinvoke. i've used a c++ to vb converter to get the following:
<DllImport("acad.exe", CallingConvention:=CallingConvention.Cdecl, EntryPoint:="?DisplayContextMenu@AcStatusBarItem@@UAEIAAVCMenu@@VCPoint@@@Z")> _
Public Shared Function DisplayContextMenu(ByRef menu As CMenu, ByVal point As CPoint) As UInteger
End Function
and have replaced 'CMenu' with Autodesk.AutoCAD.Windows.Menu and 'CPoint' with System.Drawing.Point to get the following:
<DllImport("acad.exe", CallingConvention:=CallingConvention.Cdecl, EntryPoint:="?DisplayContextMenu@AcStatusBarItem@@UAEIAAVCMenu@@VCPoint@@@Z")> _
Public Shared Function DisplayContextMenu(ByRef menu As Autodesk.AutoCAD.Windows.Menu, ByVal point As System.Drawing.Point) As UInteger
End Function
which (not surprisingly) crashed AutoCAD nicely. Obviously these are wrong... can anyone point me in the right direction???
thanks in advance
Cheers, Mark