help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Open existing instance of app from Emacs lisp?


From: B. T. Raven
Subject: Re: Open existing instance of app from Emacs lisp?
Date: Sat, 09 Aug 2008 07:42:53 -0500
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

David Wolff wrote:
Hi all,

I used "w32-shell-execute" to open apps, documents, and folders in a
very nice little menu, eg:

     (w32-shell-execute "open" "C:/WINDOWS/System32/calc.exe")

Then I discovered that, for applications, this always opens a new
instance instead of switching to an existing copy.  Just what I need, 14
copies of Calculator running.  :-)

So okay, I can use w32-window-exists-p to see if the app is already
running.  Now is there a way to activate the app from lisp?

Thanks --

David

(Remove "xx" to reply.)

Apparently someone called XSteve (an Austrian??) has put together "sww.exe" and sww.el that will do what you want. Google on these. I wasn't able to try them because I am missing mfc71.dll and I don't know where to download it safely. If you have this dll you will probably be able to switch between windows apps from within Emacs. The closest I can get to what you want is:

(if (not (w32-window-exists-p nil "Calculator"))

  (w32-shell-execute "open" "C:/Winnt/System32/calc.exe"))

and then use Alt-Tab to bring up calculator.

By the way, the calc programs (simple and programmable) embedded within Emacs are far superior to the msw Calculator program.

Ed


reply via email to

[Prev in Thread] Current Thread [Next in Thread]