• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    .NET

    Reply
    Valued Contributor
    Posts: 63
    Registered: ‎04-04-2012

    Alternative method for SetFocusToDwgView()?

    77 Views, 1 Replies
    01-15-2013 01:02 AM

    Unfortunately, ARX 2007 does not provide Autodesk.AutoCAD.Internal.Utils.SetFocusToDwgView().

    What would be the best way to mimic this method?

    Please use plain text.
    Moderator
    Alexander.Rivilis
    Posts: 1,167
    Registered: ‎04-09-2008

    Re: Alternative method for SetFocusToDwgView()?

    01-15-2013 03:08 AM in reply to: dynamicscope

    Try this code (not the same as SetFocusToDwgView but can be helpful):

    [DllImport("user32.dll")]
    extern static IntPtr SetFocus(IntPtr hWnd);
    static void SetFocusToActiveDocument()
    {
      SetFocus(Application.DocumentManager.MdiActiveDocument.Window.Handle);
    }
    static void SetFocusToMainWindow()
    {
      SetFocus(Application.MainWindow.Handle);
    }

     

     

     


    Пожалуйста не забывайте про Утвердить в качестве решения!Утвердить в качестве решения и Give Kudos!Баллы
    Please remember to Accept Solution!Accept as Solution and Give Kudos!Kudos

    Please use plain text.