View Full Version : ShutDownPlugin

2004-04-09, 10:15 PM
I've done a plugin to replace the Exit button on the Main Menu. It is able to shut the computer down or reboot it.

It's almost done too http://gbpvr.com/iB_html/non-cgi/emoticons/cool.gif

Should be able to put a link to the source within a couple of hours http://gbpvr.com/iB_html/non-cgi/emoticons/tounge.gif

It is built upon the WeatherPlugin.


2004-04-09, 10:26 PM
Cool. Good idea.

2004-04-09, 11:37 PM
Speaking of plugin source, can we somehow get the source/binary to you to make them available via the website?

2004-04-09, 11:40 PM
Yes, no problem. If you've got some thing you'd like to share, email it to me at support@devnz.com and I'll make it available on a web page.

2004-04-10, 07:20 AM
I emailed the plugin to sub, but as it hasn't made it's way in here yet I'm posting a link myself:


It's not final, but I guess there are curious pepole around http://gbpvr.com/iB_html/non-cgi/emoticons/smile.gif


2004-04-10, 07:35 AM
Thats strange, the email didn't arrive.

2004-04-10, 07:44 AM
I've just given it a quick go. Well done. It looks good. I'll upload it to a webpage tomorrow. I've had enough for today.

2004-04-10, 12:28 PM
I checked it out. It doesn't seem to respond to the mouse in your Exit window. I can use the keyboard to go up-down to all the buttons but if I click on a button with the mouse nothing happens. Button doesn't highlight. Looking good though. When you finish it up I'll try to incorporate it in my skin.


2004-04-10, 01:39 PM
I know about the mouse, I hadn't incorporated it yet...
It's done now, but I'm working at skining it some more.


2004-04-10, 03:04 PM
Great job. Looking forward to it.


2004-04-11, 11:24 PM
A new release of my ShutDown plugin is available at:

For the end user the MouseClick is implemented, as for the code, just compare it to the old and I hope u like it http://gbpvr.com/iB_html/non-cgi/emoticons/smile.gif

The error detection for the skin is scarce, maybe I'll implement something http://gbpvr.com/iB_html/non-cgi/emoticons/smile.gif

Tomorow I'll implement globalization.


2004-04-11, 11:36 PM
Nice job. I will look at the code later.

You have the pdb file in the zip, is this a debug build?

2004-04-11, 11:47 PM
yes, it's a debug build, not that it matters as u can't debug it http://gbpvr.com/iB_html/non-cgi/emoticons/mad.gif

2004-04-11, 11:52 PM
I know. I can't figure out why not either. It seems to try, but then claims you can never make it to the breakpoint. Could we need a pdb and debug build for gb-pvr I wonder?

2004-04-12, 12:00 AM
Something still is not quite right with the mouseclick. If I click on the shutdown button it highlights the exit button and just exits the app. If I click on restart or exit it treats it as clicking the main menu button and goes back to the main menu. If I click Main menu that works as advertised. Closer.


2004-04-12, 12:06 AM
It claims it can't load the symbols:
'GBPVR.exe': Loaded 'ShutDownPlugin', No symbols loaded.

Probably because GBPVR is not Debug build and/or he used dotfuscator to hide the IL.


2004-04-12, 12:35 AM
The Mouse function works now, I checked it http://gbpvr.com/iB_html/non-cgi/emoticons/smile.gif
As I don't use a mouse with the app, I don't test it that much..

It's up on the usual place, I'm going to sleep now...

2004-04-14, 08:47 PM
Should shutdown option turn also power off? Normally when I choose shutdown from windows (w2k) my machine turns off automatically. With Shutdown plugin I just get the windows message "It's now safe to turn off..." and I need to press button manually.

2004-04-14, 08:52 PM
That's strange... It shut's down my laptop without a problem...
The shutdown plugin uses the Windows Managment Interface to send a shutdown command. I had this kind of problem on an older machine, specially when runing Windows 2000. The shutdown screen came up.

Please tell me your machine specs and OS used. I'll try to check it out.

2004-04-14, 08:57 PM
My gb-pvr machine is an old Compaq deskpro En series with 400Mhz PII processor. OS is windows 2000 with SP4 and the other latest MS updates.

2004-04-14, 09:04 PM
That might be the problem, as my problematic machine was also a P2. I will however check if I can simulate an ACPI shutdown signal somehow, the shutdown is taking awfull long time on my machine...

2004-04-20, 02:35 PM
Great plugin thank you.

Now a wishlist for the plugin.....Add an Abort (Restart or Shutdown) and extend these two functions to Restart/Shutdown in XX seconds so you have time to Abort.

I used a custom task to Restart or Shutdown in 30 seconds and had an Abort. Your plugin replaced these but I miss the Abort.


2004-04-21, 07:23 AM
I second the abort and shutdown in x seconds. I had a custom task as well, but this one is far better.

BTW, is there only a blue skin available. I'm using the red sky skin, and shutdown is the odd one out. On the other side, then it is *very* clear something crucial is going on.

Oh, the install wasn't a complete no-brainer. But I managed.

2004-04-26, 06:58 AM
Myself and a friend added a button to the Shutdown plugin that puts the system into Standby.

TypQxQ if you are interested I'll send you the source. We're not artistic so you'd probably need to tweak the button images and the background image a bit. http://gbpvr.com/iB_html/non-cgi/emoticons/smile.gif

Works though.


2004-05-12, 07:23 AM
The shutdown plugin is the one I use most...

However, I noticed it says "shutig down the computer", only very minor, but I thought I mention it here anyway.

Is there any progress on this plugin?

2004-05-19, 11:44 PM
Is it possible to get at the power schemes (at least on an XP box)? I tend to setup a different scheme for recordings, and it would be sweet to be able to change this from with GBPVR.

I haven't looked too much at the C# api's in this area,


2004-05-20, 12:06 AM
I'd guess these are accessible from C#. Even if the .net framework API dont directly provide this functionality, it is always possible to call native WIN32 APIs.

2004-05-26, 01:28 AM

Not sure if powering down the PC is still an issue, but if it is, take a look at:


instead of the


method of the Win32_OperatingSystem class. I've used it in the past and had better success w.r.t powering down a system. I was having the same "non-power down" issue, and switched to this method instead and it solved my problems. It can probably replace your reboot code too to shorten your total lines of code (not that it's long by any means).

2004-05-30, 06:46 AM
Quote[/b] (MC001 @ April 26 2004,07:58)]Myself and a friend added a button to the Shutdown plugin that puts the system into Standby.
Any news of this being a possible feature - love the plugin but would love it even more if it had standby as well. http://gbpvr.com/iB_html/non-cgi/emoticons/biggrin.gif

2004-05-30, 06:52 AM
I think the original author is no longer with us.

MC001, or any one else thats able to make the change, let me know and I'll make it available to others.

2004-07-27, 07:22 PM
I have found a workaround for the standby thing..

First, download this program: http://www.rtsecurity.com/products/rshut/cmdline.shtml. Then make a new task in GBpvr (maybe called "Standby"), which runs RshutPro.EXE with the argument "/suspend".

That's about it http://gbpvr.com/iB_html/non-cgi/emoticons/smile.gif

2004-08-19, 09:06 PM
Quote[/b] (nkh @ July 27 2004,15:22)]First, download this program: http://www.rtsecurity.com/products/rshut/cmdline.shtml.
I just found a small alternative, http://www.fixup.net/download/utils/suspend/suspend.zip

Got both suspend and hibernate alternative exe files, all files 12k each...

2004-08-26, 02:47 AM
Hey All,

Ok I know how to work with the power management dll and can get a list of the various power schemes, etc. can change to whatever I want, and can shutdown/hibernate the system.

Well i can do this from purebasic, not sure how to do this in C#. If anyone can assist with interfacing with this stuff

powermanagement (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/power/base/getpwrcapabilities.asp)

in C# that would be great, otherwise I'll write a purebasic DLL and interface with it.

The reason I want to do this is if i start up the MVP i want to be able to change power schemes as most of the time i forget and my computer goes to sleep half way through watching something http://gbpvr.com/iB_html/non-cgi/emoticons/biggrin.gif

So i though the Shutdown plugin would be a good one to extend


2004-08-26, 06:24 AM
Quote[/b] ]The reason I want to do this is if i start up the MVP i want to be able to change power schemes as most of the time i forget and my computer goes to sleep half way through watching something
I'd not really thought of this situation. If you want, I can change GB-PVR to keep the machine awake. What would the rule be though? if there is an GB-PVR MVP Server running, keep the machine running?. I suppose the user may want to use the MVP at any time, and they dont want to have to go power up the machine.

2004-08-26, 06:26 AM
Actually thinking about it further, I suspect if you were running MVP clients you'd probably not configure your computer to auto standby/hibernate.

2004-08-26, 11:22 AM
I think this falls more into the category of occasional MVP user, so I thought this may be better suited to an extension of the Shutdown plugin (or possbily renaming it to Power Management plugin).

I don't think you should change GBPVR for this. IMHO the user should be responsible for setting up the power scheme.

Is it possible as a plugin to detect if a MVP server has started?


2004-08-26, 05:08 PM
IPluginHelper.GetClientIdentifier() returns MVP + the MAC address

2005-01-06, 08:11 PM
Quote[/b] (sisuomin @ April 14 2004,16:47)]... With Shutdown plugin I just get the windows message "It's now safe to turn off..." and I need to press button manually.
I have the same issue when using the Shutdown plugin. Anything I can do to resolve this so I don't physically have to click on the power button? I am rather lazy, and this does require me to physically:
1. get up
2. open the stereo cabinet glass door
3. press the power button

2005-01-09, 05:19 PM
try this http://support.microsoft.com/?kbid=810903

2005-01-09, 05:41 PM
every time i try to restart or shut down via the shutdown plugin i get a "object not set to an instance of an object", and gbpvr.exe.log doesnt record anything interesting, anyone know what it might be?

2005-01-09, 08:14 PM
Quote[/b] (Huw @ Jan. 09 2005,12:19)]try this http://support.microsoft.com/?kbid=810903
Thanks, Huw. i did read the artcile before, and I believe everything is setup correctly. This only happens when I use the plugin. Normal shutdown through Windows menu works properly.