Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

Check if program is running

Announcements of new plugins or updates.

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo

Post Reply
MORA
Posts: 14
Joined: March 7th, 2007, 5:21 pm

Check if program is running

Post by MORA »

Dont know if someone already made something similar, couldnt find it atleast.


This is a simple plugin for smartie to check which programs/processes is running.
I use it to switch to specific screens only when those programs are running.

Usage.
1) Place dll in plugin dir.
2) Make some actions based on your needs.
Below is an exsample of VLC,Winamp and a system info screen.
When vlc is running screen 3 is showing (also if winamp is running)
When winamp is running screen 2 is showing
When none of them are running screen 1 is showing.

Screen 2 and 3 are set to sticky and not enabled (to be excluded from rotation)

if $dll(AppState,1,vlc_winamp,) = 0 then EnableScreen(1)
if $dll(AppState,1,vlc_winamp,) = 2 then EnableScreen(2)
if $dll(AppState,1,vlc_winamp,) = 1 then EnableScreen(3)
if $dll(AppState,1,vlc_winamp,) = 3 then EnableScreen(3)

The plugin returns a binary code depending on which programs are running (from the list in param1, seperated with _)
1. program = 1
2. program = 2
3. program = 4
etc...

The return value are added together, so if program 1 and 2 are running it returns 3, if 2 and 3 are running its 6.

The plugin is in C# source is included.
You do not have the required permissions to view the files attached to this post.

jon
Posts: 4
Joined: February 22nd, 2010, 9:39 pm

Re: Check if program is running

Post by jon »

bonjour je voudrais savoir comment remplacer la valeur qui s'affiche 0 ou 1 quand le programme tourne ou pas
Merci d'avance

hello I would like to know how to replace the value that appears 0 or 1 when the program is running or not
Thank you in advance

caesar
Forum Supporter
Posts: 734
Joined: October 15th, 2005, 10:39 am
Location: Romania
Contact:

Re: Check if program is running

Post by caesar »

Nesting this dll under "search and replace" (sandr) plugin should allow you to replace 0 and 1 with "running" and "stopped" or anything else you wish.

jon
Posts: 4
Joined: February 22nd, 2010, 9:39 pm

Re: Check if program is running

Post by jon »

yes I change the file but I can not manage to compile after making the change

PhilYHC
Posts: 21
Joined: March 11th, 2010, 9:19 pm

Re: Check if program is running

Post by PhilYHC »

this is EXACTLY what i am after!

but for the life of me i cant get it to work!

i am running lcd smartie 5.4, and i am just testing it out with the following:

screen 1 just has "page 1" on it,
screen 2 has if $dll(AppState,1,vlc,) = 0 then EnableScreen(1)
if $dll(AppState,1,vlc,) = 1 then EnableScreen(4)
screen 3 has "page 3" on it
and page 4 has "test ok" on.

obv page 4 is not enabled, and is sticky.

if anyone can point me in the right direction i would be most grateful!

PhilYHC
Posts: 21
Joined: March 11th, 2010, 9:19 pm

Re: Check if program is running

Post by PhilYHC »

ignore the above, i was being a complete numpty, its all good now!

MegaVV
Posts: 2
Joined: October 31st, 2010, 9:06 pm

Re: Check if program is running

Post by MegaVV »

would you explain to me?
I didn't understand
My 2 screen shows itunes informations
I want to every time i play a music on itunes, lcdSmartie shows the 2 screen
What I have todo?
Sorry for my bad english, I'm brazilian

limbo
Plugin Author
Posts: 1604
Joined: February 13th, 2005, 7:38 pm
Location: Athens - Greece
Contact:

Re: Check if program is running

Post by limbo »

Under actions...
if $dll(AppState,1,itunes) = 1 then Gotoscreen(2)

toonamo
Posts: 1
Joined: February 2nd, 2011, 1:55 am

Re: Check if program is running

Post by toonamo »

new to this so please forgive me but i am getting this pop up message when attempting to use AppState.dll
Load of plugin failed: Plugin AppState.dll had an exception during Init: External exception E0434F4D
I thought this was perhaps something to do with rights so i ran as an administrator and it still gave me the popup. I am running windows 7 64 bit with UAC on. I am also running smartie lcd 5.4

Any thoughts on what is causing this error?

Stiller
Posts: 8
Joined: April 22nd, 2012, 9:02 am

Re: Check if program is running

Post by Stiller »

limbo wrote:Under actions...
if $dll(AppState,1,itunes) = 1 then Gotoscreen(2)
I tried it in this way, but LCD Smartie does not change the screen.

PhilYHC
Posts: 21
Joined: March 11th, 2010, 9:19 pm

Re: Check if program is running

Post by PhilYHC »

this is what i have been using:

if $dll(AppState,1,XBMC,) = 1 then EnableScreen(4)

if $dll(AppState,1,XBMC,) = 0 then EnableScreen(1)

on the screen you want to show, UNcheck enabled, and CHECK sticky.

Stiller
Posts: 8
Joined: April 22nd, 2012, 9:02 am

Re: Check if program is running

Post by Stiller »

PhilYHC wrote:this is what i have been using:

if $dll(AppState,1,XBMC,) = 1 then EnableScreen(4)

if $dll(AppState,1,XBMC,) = 0 then EnableScreen(1)

on the screen you want to show, UNcheck enabled, and CHECK sticky.
This is exactly my configuration. But it did not work...Should I config the applications somewhere?

jon
Posts: 4
Joined: February 22nd, 2010, 9:39 pm

Re: Check if program is running

Post by jon »

bonsoir ayant j'aimerais quelques précisions sur se plugin
je m'en était servit il ya lontemps mais impossible de le refaire fonctionner
par exemple j'ai un programme test.exe que j'aimerais afficher s'il est lancer
que faut il que je fasse merci d'avance
Désoler je ne suis pas anglais

"hello I would like to have some clarification on is plugin
I was served there lontemps but impossible to run again
For example I have a test.exe program I want to launch display if
what should he do that I thank you in advance
I'm sorry i'm not English"

lcd300
Posts: 2
Joined: May 3rd, 2013, 11:55 pm

Re: Check if program is running

Post by lcd300 »

ok guys i have tested it. the proper code is:

if $dll(AppState,1,iTunes,) = 1 then GotoScreen(2)
if $dll(AppState,1,iTunes,) = 0 then GotoScreen(1)

But notice that it line 1 is active always when iTunes is runnunig (even if this paused).

Question: is it possible to check if iTunes is paused/stopped?

lcd300
Posts: 2
Joined: May 3rd, 2013, 11:55 pm

Re: Check if program is running

Post by lcd300 »

And now a bit improved version for you that works good:

Exaple for 2 screens:

if $dll(itunes2,1,Stat,1) = playing then GotoScreen(2)
if $dll(AppState,1,iTunes,) = 0 then GotoScreen(1)
if $dll(itunes2,1,Stat,1) = stopped then GotoScreen(1)

When ever iTunes is playing, it goes to screen 2
If iTunes is stopped or paused it goes to screen 1

Here you have more parameters (in green color):

http://code.google.com/p/lcd-smartie/so ... es2.cs?r=2

For itunes plugin you will nee also:

- the msvcr71.dll (http://de.dll-files.com/msvcr71.dll.html) - you have to register the dll properly
- the .net framework for clients (comes with the regular windows updates)

that's all folks. have fun.

Post Reply