TheSwamp

Code Red => ARX Programming => Topic started by: ahlzl on February 03, 2010, 08:54:18 PM

Title: How to P/Invoke acedGetAcadFrame
Post by: ahlzl on February 03, 2010, 08:54:18 PM
Hello all:
How to P/Invoke acedGetAcadFrame()->setFocus();

I know :
Code: [Select]
[DllImport("acad.exe", EntryPoint = "?acedGetAcadFrame@@YAPAVCMDIFrameWnd@@XZ",
CharSet = CharSet.Auto)]
but…… :-(
Title: Re: How to P2Invoke acedGetAcadFrame
Post by: It's Alive! on February 03, 2010, 09:48:09 PM
what version of autocad are you using?
Title: Re: How to P2Invoke acedGetAcadFrame
Post by: ahlzl on February 03, 2010, 10:00:11 PM
to Daniel: AutoCAD 2008 or other.
Title: Re: How to P/Invoke acedGetAcadFrame
Post by: It's Alive! on February 03, 2010, 10:10:15 PM
you might try something like

Code: [Select]
   
    [DllImport("user32.dll")]
    private static extern System.IntPtr SetFocus(System.IntPtr hwnd);
    //
    private void SetFocusTo()
    {
      //SetFocus(AcadApp.DocumentManager.MdiActiveDocument.Window.Handle);
      //or
      SetFocus(AcadApp.MainWindow.Handle);
    }
Title: Re: How to P/Invoke acedGetAcadFrame
Post by: ahlzl on February 03, 2010, 10:41:52 PM
I thank Daniel'number is N!
today, the number iequal N + 1!

great Daniel!
Title: Re: How to P/Invoke acedGetAcadFrame
Post by: frtfff on February 04, 2010, 10:09:20 AM
 :-(