Checking if another application is running from C/SIDE

admoretutsie
Member Posts: 79
How can l go about checking if another application is running from within Navision??
$cside -MBS
>install Navision::4.0 SP1
>q
$
oOo
>install Navision::4.0 SP1
>q
$
oOo
0
Comments
-
What specific application do you want to test?0
-
The business notification client, ie MBS directory\businessnotificationmanager\notificationmanager.exe
Thanks$cside -MBS
>install Navision::4.0 SP1
>q
$
oOo0 -
Here an example with the calc.exe
Name DataType Subtype Length WSHShell Automation 'Windows Script Host Object Model'.WshShell AppName Text 30 AppExe Text 30 WinStyle Variant if isclear(WSHShell) then create(WSHShell); AppName := 'Rechner'; AppExe := 'calc.exe'; WinStyle := 1; if not WSHShell.AppActivate(AppName) then WSHShell.Run(AppExe,WinStyle) //Startet den calc.exe else WSHShell.Popup('Läuft bereits'); //Bringt den Rechner in den Vordergrund clear(WSHShell);
regardsDo you make it right, it works too!0 -
Thnaks for the enlightment on the WSHShell automation server, it really is handy a shell. Where can l get all the methods for this automation server$cside -MBS
>install Navision::4.0 SP1
>q
$
oOo0 -
Use the C/AL Symbol Menu or take a look into variables and by the automation press F6. Here you can see, what WSH can do.
regardsDo you make it right, it works too!0 -
I have been looking at the methods provided by WSHShell, and none of them allows me to check if an application (e.g is calc.exe ) is currenlty running.
A look at the following will illustrate what l am trying to say.
http://msdn.microsoft.com/archive/defau ... ShellM.asp
Unfortunately, that leaves my question open, but not as wide as it was at first.
Regards$cside -MBS
>install Navision::4.0 SP1
>q
$
oOo0 -
admoretutsie wrote:[...] none of them allows me to check if an application (e.g is calc.exe ) is currenlty running.
[...]Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
By my (german) Windows, the Applicationname for calc.exe is 'Rechner'. You must change this to, i think, 'calculator' (?).
RegardsDo you make it right, it works too!0 -
Now, l had the AppName wrong, after changing the above example to "Calculator", it works just the way l wanted it to...
Thanks guys!!!!!
=D>$cside -MBS
>install Navision::4.0 SP1
>q
$
oOo0 -
Please.Do you make it right, it works too!0
-
It hits me hard, really hard. the problem:
After implementing the "Calculator" example, when l manually run the codeunit, ( l created a codeunit (50000)) that has the above code), everything is ok. When l execute CODEUNIT.RUN(50000) in some trigger, a new calculator is being started. My codeunit 50000 is as follows:
NB: Oyster is an OCX that has "SHELL" functionality and does not bring SHELL errors in some appliation paths.
IF ISCLEAR(WSHShell) THEN
CREATE(WSHShell);
Navision := COMPANYNAME;
NavisionExe := 'C:\Program Files\Microsoft Business Solutions-Navision 4.0\Client\finsql.exe';
AppName := 'Calculator';
AppExe := 'calc.exe';
IF NOT WSHShell.AppActivate(AppName) THEN BEGIN
Oyster.Oyster(AppExe);
SLEEP(800); //Wait until the CALC is up and running by waitng for 8 seconds.
END;
//Bring Navision back to be the active screen
IF NOT WSHShell.AppActivate(Navision) THEN
Oyster.Oyster(NavisionExe);
CLEAR(WSHShell);
](*,)$cside -MBS
>install Navision::4.0 SP1
>q
$
oOo0 -
Navision := COMPANYNAME;
NavisionExe := 'C:\Program Files\Microsoft Business Solutions-Navision 4.0\Client\finsql.exe';
Is it true, that the Navisionwindows name is only the companyname:?:
My Navision shows the companyname and " - Microsoft business Solutions-Navision"Do you make it right, it works too!0 -
Navision := COMPANYNAME;
NavisionExe := 'C:\Program Files\Microsoft Business Solutions-Navision 4.0\Client\finsql.exe';
Is it true, that the Navisionwindows name is only the companyname:?:
My Navision shows the companyname and " - Microsoft business Solutions-Navision"
That is right, COMPANYNAME only is not the title tar text, but its the one that is running the Navision client. l think the existance of spaces in the text raises confusing in the appactivate() function. if you check out the appactivate API, it checks if the parameter is "contained" in the apps that are running. :-k$cside -MBS
>install Navision::4.0 SP1
>q
$
oOo0 -
Very handy thingy - but how can I kill the extra slave.exe 's :roll: :-k (or better use it within same slave), which is the result of running WSHShell.Run(AppExe,WinStyle) - the extra slave takes control over my printer and ... :-s ?
Anybody :-k ?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions