Is an application already running?

Automations No Comments

Sometimes you need to start applications from Navision. If an application already is running – you can use sendkeys as described previous to activate it, and thereby you don’t want to start it again.
There are several ways of checking for an active application. One way is to use WshShell and perform a tasklist in a command prompt and parse the result afterwards. A second way is to exploit the ‘Navision Attain Hash 1.0′ automation. Here you can use IProcessUnloadObserver to check for active applications.

Example:

CREATE(Hash);
IsNavClientActive := Hash.IsProcessInMemory(‘finsql.exe’);
CLEAR(Hash);

where Hash is the automation ‘Navision Attain Hash 1.0′.IProcessUnloadObserver

Leave a Reply

You must be logged in to post a comment.

Icons by N.Design Studio. Designed By Ben Swift and Customized by Ingrid Byllemos. Powered by WordPress
Entries RSS Comments RSS Log in