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
Be the first to comment