Page 1 of 2
Show current game playing plugin?
Posted: April 21st, 2019, 9:33 pm
by trihy
Hi guys. I was thinking about a plugin for showing which game are you playing.
Could be a plugin that shows if an exe from a txt file is running, and show the name according to the txt file.
Just, if xxx.exe (game exe or whatever you want) is running, show xxxx (correct game, app, etc name)
User will have to check the .exe name and write it on the txt file.
ie. txt file
dyinglight.exe = Dying Light
bf5.exe = Battlefield V
So it will show Dying light instead of dyinglight.exe
Any other suggestion is welcome.
Thanks.
Re: Show current game playing plugin?
Posted: April 23rd, 2019, 11:02 pm
by dperrow
This should be fairly easy, I'll have a look over the next few days.
There was a plugin called 'activ' I think which you could do something similar by putting it in line in the smartie display e.g. something like:
$if($dll(activ,1,"game.exe",),"this game",,)
but I'll have a play anyway.
Re: Show current game playing plugin?
Posted: April 23rd, 2019, 11:46 pm
by trihy
dperrow wrote:This should be fairly easy, I'll have a look over the next few days.
There was a plugin called 'activ' I think which you could do something similar by putting it in line in the smartie display e.g. something like:
$if($dll(activ,1,"game.exe",),"this game",,)
but I'll have a play anyway.
Hi. Thanks. Couldnt find that plugin but seems to be the same purpose I was looking for.
Also could be used for other programs. But other programs has more chance to be running at the same time. Not sure how the plugin should handle this. Maybe if more than one program is active, just show all of them in different screens.
Re: Show current game playing plugin?
Posted: April 24th, 2019, 2:36 pm
by dperrow
Okay, here we go. the attached dll goes in the plugins file along with the cfg file.
it gets called in smartie by $dll(Chkexe,1,,)
the cfg file contains what you suggested but things to note are:
a hash(#) at the start of a line means that line is ignored, for comments etc.
the line format is thing.exe=output string
the whole line is case sensitive
note that you need the .exe included in the string
no spaces before the exe or before or after the =
try it and let me know.
Chkexe.zip
Re: Show current game playing plugin?
Posted: April 24th, 2019, 2:37 pm
by dperrow
ignore the counter.zip please. slip of the finger!!!
Re: Show current game playing plugin?
Posted: April 24th, 2019, 4:47 pm
by trihy
dperrow wrote:ignore the counter.zip please. slip of the finger!!!
Hi. Downloaded chkexe.zip.
Tried chrome browser, worked fine. Tried some games and worked but with a few exceptions.
I noticed that if a game or app is run as admin, wont show on lcd screen.
Not sure if this can be solved.
Thanks!
Re: Show current game playing plugin?
Posted: April 24th, 2019, 5:31 pm
by dperrow
trying to get info on an admin process from a user process sounds like a direct violation of Windows security so this doesn't entirely surprise me. Short term solution would be to run LcdSmartie as admin which I've tried and it seems to work. However, I'll have a look at the windows API and see if can be done from a user process.
Re: Show current game playing plugin?
Posted: April 24th, 2019, 7:38 pm
by dperrow
okay, found a way to lower the access made to get the process name so give this a try and let me know.
Chkexe.zip
Re: Show current game playing plugin?
Posted: April 25th, 2019, 1:53 pm
by trihy
dperrow wrote:okay, found a way to lower the access made to get the process name so give this a try and let me know.
Chkexe.zip
Hi. Thanks!
Yes, works great now for apps that require admin privileges. So no need to run lcdsmartie as admin
Will configure a couple of .exe and see how it goes.
There should be any entries limit for .exe cfg file list?
Re: Show current game playing plugin?
Posted: April 25th, 2019, 3:49 pm
by dperrow
I set the limit to 16 and the maximum string size to 64 but I can increase these easily.
Re: Show current game playing plugin?
Posted: April 25th, 2019, 5:58 pm
by trihy
dperrow wrote:I set the limit to 16 and the maximum string size to 64 but I can increase these easily.
Hi. You mean 16 games on the list?
I think it should be increased to 100 at least
I have many emulators that could add to the list, among media players, apps, etc
It will be great if you can increase it
String size maybe up to 96? 64 should be fine, but there are some games with really large names. Just to make it future proof
Thanks
Edit. I was wondering if we can have some kind of info on the second lcd line.
It will be a little more difficult I guess. But we can add some description of the app or game to a second line that should show on the second line on the lcd?
I mean ie cfg file:
Mkx.exe=Mortal Kombat X
Mkx.exe=Fighting Game Released on 2015 Up To 2 players, etc.
Maybe using something like
1mkx.exe=
2mkx.exe=
So 1 will be showed on lcd line 1 and 2 on second line/row.
Re: Show current game playing plugin?
Posted: April 25th, 2019, 6:25 pm
by dperrow
Okay, i've increased the limit to 256 and the maximum string size to 128.
I've also added function 2 to do something the same as the Activ dll it takes 2 parameters, the exe name and what to return if it's active. e.g.
$dll(Chkexe,2,firefox.exe,Browser)
have fun....
Chkexe.zip
Re: Show current game playing plugin?
Posted: April 25th, 2019, 6:29 pm
by trihy
dperrow wrote:Okay, i've increased the limit to 256 and the maximum string size to 128.
I've also added function 2 to do something the same as the Activ dll it takes 2 parameters, the exe name and what to return if it's active. e.g.
$dll(Chkexe,2,firefox.exe,Browser)
have fun....
Chkexe.zip
Thanks! That was really fast. Let me check later when on the pc. And report back

Re: Show current game playing plugin?
Posted: April 25th, 2019, 6:40 pm
by trihy
dperrow wrote:Okay, i've increased the limit to 256 and the maximum string size to 128.
I've also added function 2 to do something the same as the Activ dll it takes 2 parameters, the exe name and what to return if it's active. e.g.
$dll(Chkexe,2,firefox.exe,Browser)
have fun....
Chkexe.zip
Hi. Not sure how to work with the second line.
I did this
$dll(Subst,1,$dll(Chkexe,1,,),)
And
$dll(Subst,1,$dll(Chkexe,2,DyingLightGame.exe,Dying Light es un juego de acción en primera persona del género survival horror),)
And works great, but second line should be defined on cfg file, If not it will be only for this particular game. Right?
Also since game description are quite large, maybe string size for line 2 should be a little higher.
Sorry for the on the fly changes

Re: Show current game playing plugin?
Posted: April 25th, 2019, 7:56 pm
by dperrow
what if i put a / in the string to indicate the second, third and fourth display lines and added a parameter to the dll call to select which line e.g.
game1.exe=line 1 display/line 2 display/line three display
$dll(Chkexe,1,1,) would show "line 1 display"
$dll(Chkexe,1,2,) would show "line 2 display"
$dll(Chkexe,1,3,) would show "line three display"
$dll(Chkexe,1,4,) would show nothing
what do you think?
Re: Show current game playing plugin?
Posted: April 25th, 2019, 11:13 pm
by dperrow
Hi,
I've implemented this but rather than change what is working i've added it as function 3.
So the idea is that you put a / in the string to indicate the second, third and fourth display lines and added a parameter to the dll call to select which line e.g.
game1.exe=line 1 display/line 2 display/line three display
$dll(Chkexe,3,1,) would show "line 1 display"
$dll(Chkexe,3,2,) would show "line 2 display"
$dll(Chkexe,3,3,) would show "line three display"
$dll(Chkexe,3,4,) would show nothing
as usual, let me know how it goes.
Re: Show current game playing plugin?
Posted: April 25th, 2019, 11:17 pm
by dperrow
oops, no attachment. Here we go.
Chkexe.zip
Re: Show current game playing plugin?
Posted: April 26th, 2019, 12:22 am
by trihy
dperrow wrote:oops, no attachment. Here we go.
Chkexe.zip
Hi. Thanks for all the great work. Seems a nice approach doing that way.
I tried this
$dll(Chkexe,3,1,)
$dll(Chkexe,3,2,)
And on cfg file this
DyingLightGame.exe=Dying Light/Dying Light es un juego de acción en primera persona del género survival horror, el cual se desarrolla durante un apocalipsis zombie
Works fine for first line, but only show this part on second line:
Dying Light es un juego de acción en primera persona del género survival horror, el cual se des
And start over
Its missing:
arrolla durante un apocalipsis zombie
Seems it`s showing around 90 characters. Maybe this needs to be increased? If it need this, maybe 256 characters will be fine or even 512. Descriptions are always large.
Thanks
Re: Show current game playing plugin?
Posted: April 26th, 2019, 2:26 am
by trihy
Hi again.
Been playing a game for 20 minutes or so. And noticed that second line scroll started to lag a lot.
Then I checked task manager and lcdsmartie was using between 5 and 10% cpu usage. I have this plugin and scp2. When lcdsmartie switch to scp2, cpu use is 0,1%, when changes to chkexe it goes again to 5-10%. Not sure if this can be improved.
Thanks
Re: Show current game playing plugin?
Posted: April 26th, 2019, 12:01 pm
by dperrow
Don't see why it should be using 5-10% cpu, doesn't on mine but I'll keep looking.
Meanwhile I increased the string size to 512 and decreased the min refresh interval to see if that will do anything.
Chkexe.zip
Re: Show current game playing plugin?
Posted: April 26th, 2019, 4:16 pm
by trihy
dperrow wrote:Don't see why it should be using 5-10% cpu, doesn't on mine but I'll keep looking.
Meanwhile I increased the string size to 512 and decreased the min refresh interval to see if that will do anything.
Chkexe.zip
Hi. Thanks.
Tried but cpu usage still goes high. Even frequency step up from 800mhz to 2.5ghz when chkexe is on screen and goes back to 800mhz when other plugin is on screen.
Here are my lcdsmartie settings and chkexe cfg file if you want to replicate it. Also uploaded cpu usage when chkexe is on screen. Then goes to 0,1% using clock or scpv2 plugins.
Re: Show current game playing plugin?
Posted: April 26th, 2019, 7:44 pm
by dperrow
I suspect that the high usage is because of the dll check interval being set to 30ms combined with the amount of code being executed. Do you really need it refreshing 33 times a second??? I'll have a look at optimizing the code anyway.
BTW there was a 128 character line limit elsewhere in the program which I've fixed and will issue with the next update.
Re: Show current game playing plugin?
Posted: April 26th, 2019, 10:20 pm
by dperrow
Made some changes, optimized code a bit, so try this. No real scope to optimize further cpu use must be caused by context switching between user mode and system to get process info.
Chkexe.zip
Re: Show current game playing plugin?
Posted: April 27th, 2019, 1:51 am
by trihy
dperrow wrote:Made some changes, optimized code a bit, so try this. No real scope to optimize further cpu use must be caused by context switching between user mode and system to get process info.
Chkexe.zip
Hi. Im not sure why Im using 30ms dll check. Maybe winamp equalizer required this? Cant remember when I changed this. SCPv2 will be fine with 50 or more ms?
Tried new build of chkexe and cpu usage went down to 0,9-1%. Not sure what changed to the code but it`s a really great improvement!
Later will try to change the dll check interval and report back.
Re: Show current game playing plugin?
Posted: April 27th, 2019, 1:10 pm
by dperrow
hi, here's something else to try. I've added function 4 same parameters as function 3 and does the same thing except that it uses the values returned by the previous f1 or f3 call so uses very little cpu. So if you have 2 lines on display you can use:
$dll(Chkexe,3,1,)
$dll(Chkexe,4,1,)