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

CloseProg - closes a specified program

General discussion about LCD Smartie.

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo, Fast351

Post Reply
barnabas1969
Posts: 14
Joined: July 31st, 2011, 3:07 am

CloseProg - closes a specified program

Post by barnabas1969 »

I wrote a little program that closes a specified Windows program. It isn't a plugin, but it might be useful for some of you.

The reason I wrote it is because I have a problem with my USB controllers that causes an issue with the bignum plugin after resuming from standby. I wrote a script that runs just before the computer goes into stanby that kills LCD Smartie with the taskkill command, but some other plugins (mce_dll) don't work correctly if I kill LCD Smartie with the taskkill command, so I wrote this little program that gracefully closes another program, similar to clicking the red X at the top right-hand corner of a window.

It can be used to close any Windows program, including LCD Smartie.

Here's how it works:

CloseProg.exe <parameter1>

The parameter can be one of the following:

"WinItemize" - This will create a text file with a list of all open windows in your session. It will then open the file in Notepad. The file will be in your My Documents folder and will be named CloseProg.txt. Make sure to turn off word wrap when you view the file because some window names are quite long and it will be confusing to look at it when they wrap.

Example:
CloseProg.exe WinItemize

Once you figure out the window name you want to close, run the program like this:

CloseProg.exe "Window Name"

Make sure to put the parameter in quotes if your Window Name contains any spaces or special characters that the cmd.exe program will interpret as a delimiter. The Window Name is CASE SENSITIVE and can be a partial window name as follows:
  • "Some Partial Name" will match any window that BEGINS with the text in your string.
  • "Exact Window Name~" with a tilde at the end will match any window that has EXACTLY the title you specified.
  • "~Partial Name~" with a tilde at both ends will match any window that ENDS with your string.
  • "~Partial Name" with a tilde at the beginning will match any window that CONTAINS your string.
Understand that if you have multiple windows that match the string, it will select the one that was most recently accessed.

Example:
CloseProg.exe "LCD Smartie"

I don't see a way to attach a file here, so I put it on Google Docs.

Here's the link:

https://docs.google.com/leaf?id=0B9v3S7 ... 2&hl=en_US

usling
Posts: 38
Joined: September 5th, 2008, 1:55 pm

Re: CloseProg - closes a specified program

Post by usling »

Wow, nice :)
I've been looking for something like this.

But how do i set it up so that it closes LCD Smartie before computer goes to sleep? I have been able to make a task that starts smartie after sleep, but it doesn't work if smartie is already running (which it is but not working unless i close it manually).

Can you post your script please?

barnabas1969
Posts: 14
Joined: July 31st, 2011, 3:07 am

Re: CloseProg - closes a specified program

Post by barnabas1969 »

I'm using MCE Standby Tool from www.slicksolutions.eu. It can fire scripts before standby and on other events.

Post Reply