Page 1 of 1

Programming question

Posted: Sun Nov 16, 2008 8:54 am
by bidgeeman
Hi All.

Just wondering if there were any windows programmers that could offer a little advice I could pass on for a friend of mine who is trying to write a plugin in Lua for a windows app. Specifically e's trying to write a "Recent Documents" menu add on.

Here's his post:
"No matter what I do I can't target the currently open instance to open a previous document. It ALWAYS opens in a new dang instance. Even double clicking a file on the hard drive will open a new instance. Very annoying. I've searched and searched and can't find any way to target a running application instance.

If any of you are Windows "experts" or even programmers that have knowledge of how to workaround this issue I would be happy to hear it. Maybe there could be a simple application created in "basic" or something that can target an instance like the Mac does?

Many thanks for any help.
Cheers
Bidge

Posted: Mon Nov 17, 2008 11:01 pm
by mwieder
Lua, eh? Well, I'm assuming your friend doesn't have access to the source code for this application, since that's normally where this sort of thing is done: you get a handle to the running instance of the application (or null if it's not already running), then decide whether you want to launch a new instance or use the existing handle. Since a new instance is always getting launched, it's a fair bet that the application doesn't have code to handle this in its initialization section.

Any chance of using SendKeys to pass something like control-O and then the path to the file?

Posted: Mon Nov 17, 2008 11:40 pm
by bidgeeman
Thankd for the response mwieder.
I passed your comments on and will let you know how it goes.

Many thanks again.

Cheers
Bidge