Jump to content

Automatic Shutdown Doesn't Work If Screensaver Locked


Recommended Posts

Posted

I've been seeing a problem with the "Shutdown Program" option, such that the shutdown only seems to occur if the desktop is visible - if the screensaver has engaged (and is locked, i.e. password protected) then although ImgBurn closes, the PC doesn't shut down. (The burn & verify are always okay.) Is this the expected behavior ?

 

Here's a fragment from the end of a sample logfile for a session with shutdown selected :

[...]
I 06:08:40 Operation Successfully Completed! - Duration: 00:10:05
I 06:08:40 Average Write Rate: 7,980 KB/s (5.8x) - Maximum Write Rate: 8,372 KB/s (6.0x)
I 06:08:40 Cycling Tray before Verify...
W 06:08:48 Waiting for device to become ready...
I 06:09:02 Device Ready!
I 06:09:02 Operation Started!
I 06:09:02 Source Device: [1:1:0] ASUS DRW-1608P2S 1.39 (F:) (ATA)
I 06:09:02 Source Media Type: DVD-R (Book Type: DVD-R) (Disc ID: MCC 03RG20) (Speeds: 4x, 6x, 8x, 12x, 16x)
I 06:09:02 Image File: I:\HolidayPics.mds
I 06:09:02 Image File Sectors: 2,198,688 (MODE1/2048)
I 06:09:02 Image File Size: 4,502,913,024 bytes
I 06:09:02 Image File Volume Identifier: Holiday Pics
I 06:09:02 Image File Application Identifier: Truth
I 06:09:02 Image File Implementation Identifier: ImgBurn
I 06:09:02 Image File File System(s): ISO9660, UDF (1.02)
I 06:09:02 Verifying Sectors...
I 06:14:19 Device MD5: 4a539390c914a2c8e62bc4b6795a438e
I 06:14:19 Image MD5: 4a539390c914a2c8e62bc4b6795a438e
I 06:14:19 Operation Successfully Completed! - Duration: 00:05:17
I 06:14:19 Average Verify Rate: 13,871 KB/s (10.0x) - Maximum Verify Rate: 16,928 KB/s (12.2x)
I 06:14:19 Close Request Acknowledged
I 06:14:19 Closing Down...
I 06:14:29 Shutting down SPTI...
I 06:14:30 ImgBurn closed!

The last few lines look the same whether I check "Close Program" or "Shutdown Computer".

Posted
This seems to answer your question though:

 

http://support.microsoft.com/kb/910849

Hmm .. thanks .. I'm still thinking about that. Bear in mind I'm using Win2K though, while that page discusses a problem for users of XP. I take it that you're using the referenced API call "ExitWindowsEx(EWX_LOGOFF|EWX_FORCE,NULL)" ? This is a stand-alone PC (no domain) so I'm not sure the "DisableCAD Group Policy setting" will be enabled, but the other criteria certainly apply.

 

FYI, DVD Shrink 3.2 succeeds in shutting down the PC when I leave it running, check the relevant option ("Backup DVD | Options | Shutdown Computer When Backup Complete"), and lock the session - I just ran a test to be sure. Is it possible to find out what API call Shrink uses ? In case it's useful, whatever method DVD Shrink uses doesn't give any other applications you have running at the time a chance to tidily exit - it just brutally shuts Windows down - which has the serendipitous side-effect that when I restart Windows, login, and fire up Firefox again, it offers to "restore my session" - i.e. reopens all my the web pages I was previously reading at the time I "locked & left" ... which is nice, as it happens :)

 

Maybe Shrink uses the 'EWX_FORCE' option, and ImgBurn uses 'EWX_LOGOFF' .... ?

 

I realise most folks here have no need for this function (maybe you all live in nice safe environments where you can leave the PC unattended and unlocked :hippy:) but some of us need to lock before we leave :ermm:

Posted

As you say, it probably uses the flag to force it, I don't, but I guess I could.

 

The EWX_FORCE flag is one that you set alongside the normal EWX_POWEROFF one.

 

I'm not really one for forcing things to happen though, some apps might not want to close for a very good reason!

Posted

Damn, I just tested with the EWX_FORCEIFHUNG flag but that one doesn't work... only the EWX_FORCE flag does :(

 

At least that would have been slightly more user friendly.

Posted
I'm not really one for forcing things to happen though, some apps might not want to close for a very good reason!

I understand entirely your wanting ImgBurn to "play nicely with the other kids" .. I'd like it to do that too :)

 

Out of interest I've been reading the MS API docs, and note with some amusement that the spec for ExitWindowsEx() has the comment "This can cause applications to lose data. Therefore, you should only use this flag in an emergency" next to the EWX_FORCE flag, whereas their sample code for doing a system shutdown uses exactly that flag :

 

// Shut down the system and force all applications to close. 

  if (!ExitWindowsEx(EWX_SHUTDOWN | EWX_FORCE, 
		   SHTDN_REASON_MAJOR_OPERATINGSYSTEM |
		   SHTDN_REASON_MINOR_UPGRADE |
		   SHTDN_REASON_FLAG_PLANNED)) 
  return FALSE; 

  return TRUE;

 

Oh well ... it's up to you of course - it's your baby :thumbup:

 

But one last thought: you could assume that the ImgBurn user who requests "Shutdown Program" might be expected to have already closed everything else they care about - and it's their fault if they didn't ? Also, if I understand the docs properly, with XP if the user has other concurrent sessions logged in (fast user switching) then those won't get closed even if the workstation is unlocked, thus also preventing a shutdown unless EWX_FORCE is used. It seems hard to do the right thing :wacko:

Posted
It seems hard to do the right thing

 

lol tell me about it!

 

They need another flag that actually works to close a locked workstation but DOES ask the apps to close nicely and waits a while for them to do so (before then forcibly shutting them down).

 

The EWX_FORCEIFHUNG one would have been ok if only they'd also made that one able to shutdown a locked pc.

 

Silly MS :rolleyes:

 

 

Now I need to think if it's best to default to 'Forced' shutdown or to tell the user to make that change themselves via the checkbox. When I did it lastnight, I went with default=forced (because it would work for more people straight out the box, so to speak).... now the more I think about it, the more I don't want it being forced and I want other apps to close down nicely!

Posted

Personally I don't use this function as I never turn my PC off but given the choice I too would think it best for ImgBurn to play nice and not force shut down. Otherwise you might get users complaining that ImgBurn shut down and corrupted my word doc, xls sheet etc :(

Posted

Ok, I've changed what I'd originally done!

 

It now detects if the PC is locked and then only adds the EWX_FORCE flag if it is. Hopefully that gives us the best of both worlds - as I wouldn't have thought all that many people have 'locked' machines.

 

There is now an overriding option to never force the shutdown action - just incase anyone has massive problems with this newer functionality.

Posted
:worthy: Lightning UK! :worthy:

Yep ... what lfc said :D

 

PS: I had another thought, sadly useless, on the point of ImgBurn's "carbon footprint" (sorry!) ... if it were possible to tell the PC to Hibernate, that would solve all the issues ... nobody's app would be brutalised, and no unnecessary electrons would be wasted. Unfortunately there doesn't seem to be any such option with any of the Win32 interfaces for requesting a shutdown - sigh.

 

Lightning UK!, thanks for looking into this and finding a way forward that sounds ideal for everyone. More class.

Posted

There's already an option in ImgBurn to make it hibernate (or reboot, standby, logoff).

 

It's called 'Shutdown Action' on the 'General' tab within the Settings.

 

You can also right click the 'Shutdown' checkbox when it's burning etc. The options are then on a popup menu.

Posted

Hah! Unbelievable :) I just tried it all out ... outstanding !

 

You can also right click the 'Shutdown' checkbox when it's burning etc. The options are then on a popup menu.

That's an especially nice touch (I must try right-clicking more). Tip o'the hat :worthy:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.