Author Topic: How to P/Invoke acedGetAcadFrame  (Read 2773 times)

0 Members and 1 Guest are viewing this topic.

ahlzl

  • Guest
How to P/Invoke acedGetAcadFrame
« 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…… :-(
« Last Edit: February 03, 2010, 10:05:38 PM by ahlzl »

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 6979
  • AKA Daniel
Re: How to P2Invoke acedGetAcadFrame
« Reply #1 on: February 03, 2010, 09:48:09 PM »
what version of autocad are you using?

ahlzl

  • Guest
Re: How to P2Invoke acedGetAcadFrame
« Reply #2 on: February 03, 2010, 10:00:11 PM »
to Daniel: AutoCAD 2008 or other.

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 6979
  • AKA Daniel
Re: How to P/Invoke acedGetAcadFrame
« Reply #3 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);
    }

ahlzl

  • Guest
Re: How to P/Invoke acedGetAcadFrame
« Reply #4 on: February 03, 2010, 10:41:52 PM »
I thank Daniel'number is N!
today, the number iequal N + 1!

great Daniel!

frtfff

  • Bull Frog
  • Posts: 219
Re: How to P/Invoke acedGetAcadFrame
« Reply #5 on: February 04, 2010, 10:09:20 AM »
 :-(