Startapp and switch focus.

Discussion in 'AutoCAD' started by Casey Roberts, Nov 25, 2004.

  1. I have the following code that will open a file that is in the autocad
    search path, but how do i get it to switch focus to that application
    (notepad) instead of keeping the focus on autocad?

    (defun c:run ()
    (setq filename (getstring "Type name of file (note: file must be in search
    path and include extension) "))
    (startapp "notepad.exe" (findfile filename))
    )



    Thanks,


    Casey
     
    Casey Roberts, Nov 25, 2004
    #1
  2. Casey Roberts

    hendie Guest

    I don't know if there's a way to set the focus using lisp but with VBA you can: >>

    Shell "Notepad.exe" & " " & "MyPath\MyFile.ext", vbNormalFocus

    this will open Notepad with whatever file you specify and set the Notepad window to the fore


    www.resourcecad.com ~ for your CAD solutions
     
    hendie, Nov 26, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.