TUTORIAL: Enable HIBERNATE Button in Shutdown Dialog Box !

Status
Not open for further replies.

Vishal Gupta

Microsoft MVP
Hi guys!

Today a question came into my mind that why Hibernate button is not visible in Shutdown dialog box and why it appears when we press <SHIFT> key?

So I opened msgina.dll file into Resource Hacker and started R&D with it. :D

I checked in 20100 dialog that there was an entry for Hibernate button, still it was not visible in shutdown dialog box. But when I checked its properties, I was surprised. Its Left distance and Top distance were set to 30093, 30049 respectively. It means it was there but was set to not appear in dialog box coz the dialog box size was lesser than the hibernate button.

So I set its distance from LEFT & TOP to 5 and VOILLA, it started to show in the dialog box.:cool:

Then I did some more R&D with it and added a string saying "Hibernate" and changed other items places so that all 4 items "Hibernate, Stand by, Shut down, restart" can be shown in dialog box.

So the FINAL thing is that, u hv to just change the LEFT & TOP distances of Hibernate button and it'll be visible in shutdown dialog box!

Also I'm posting the contents of the dialog box, so that u can easily just copy-paste them in the required place!

So here is the step-by-step tutorial:

1.) Open %windir%\system32\msgina.dll file into Resource Hacker.
2.) Goto Dialog -> 20100 -> 1033.
3.) If u want the following look (Hibernate button at bottom-center) :

hibernatebuttonts2.jpg


Paste following code:

Code:
20100 DIALOGEX 0, 0, 208, 122
STYLE DS_SYSMODAL | DS_SETFOREGROUND | WS_POPUP | WS_BORDER
CAPTION ""
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
FONT 8, "MS Shell Dlg"
{
   CONTROL "Flag", 20101, STATIC, SS_OWNERDRAW | WS_CHILD | WS_VISIBLE, 176, 0, 32, 26 
   CONTROL "Good Bye", 20102, STATIC, SS_OWNERDRAW | WS_CHILD | WS_VISIBLE, 7, 0, 162, 26 
   CONTROL "&Stand By", 20104, BUTTON, BS_OWNERDRAW | BS_NOTIFY | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 45, 47, 22, 20 
   CONTROL "Switch &Off", 20103, BUTTON, BS_OWNERDRAW | BS_NOTIFY | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 91, 47, 22, 20 
   CONTROL "&Reboot", 20105, BUTTON, BS_OWNERDRAW | BS_NOTIFY | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 140, 47, 22, 20 
   CONTROL "&Hibernate", 20106, BUTTON, BS_PUSHBUTTON | BS_NOTIFY | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 79, 94, 48, 20 
   CONTROL "", 20108, STATIC, SS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_DISABLED, 22, 73, 50, 8 
   CONTROL "", 20107, STATIC, SS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_DISABLED, 79, 73, 50, 8 
   CONTROL "", 20109, STATIC, SS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_DISABLED, 136, 73, 50, 8 
}
4.) OR if u want following look (Hibernate button at the same place as of other items with added string) :

hibernateenablels4.jpg


Then paste following code:

Code:
20100 DIALOGEX 0, 0, 208, 122
STYLE DS_SYSMODAL | DS_SETFOREGROUND | WS_POPUP | WS_BORDER
CAPTION ""
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
FONT 8, "MS Shell Dlg"
{
   CONTROL "Flag", 20101, STATIC, SS_OWNERDRAW | WS_CHILD | WS_VISIBLE, 176, 0, 32, 26 
   CONTROL "Good Bye", 20102, STATIC, SS_OWNERDRAW | WS_CHILD | WS_VISIBLE, 7, 0, 162, 26 
   CONTROL "&Stand By", 20104, BUTTON, BS_OWNERDRAW | BS_NOTIFY | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 68, 49, 22, 20 
   CONTROL "Switch &Off", 20103, BUTTON, BS_OWNERDRAW | BS_NOTIFY | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 117, 49, 22, 20 
   CONTROL "&Reboot", 20105, BUTTON, BS_OWNERDRAW | BS_NOTIFY | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 169, 49, 22, 20 
   CONTROL "&Hibernate", 20106, BUTTON, BS_PUSHBUTTON | BS_NOTIFY | WS_CHILD | WS_VISIBLE, 9, 49, 39, 20 
   CONTROL "", 20108, STATIC, SS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_DISABLED, 55, 73, 50, 8 
   CONTROL "", 20107, STATIC, SS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_DISABLED, 105, 73, 50, 8 
   CONTROL "", 20109, STATIC, SS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_DISABLED, 155, 73, 50, 8 
   CONTROL "Hibernate", 0, STATIC, SS_CENTER | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, 14, 73, 32, 8 
}
PS: Pressing <SHIFT> key will still work...


UPDATE: Don't forget to visit following threads:

COMPLETE GUIDE: For Windows Customization - WindowBlinds, Style XP & msstyles
MASTER TUTORIAL: Make Your Windows XP Super Fast !!!
TUTORIAL: Make Your Windows XP look-a-like Windows Vista
List of Some Useful System Utilities!

TUTORIAL: All About Resource Hacker! A Brief Tutorial
TUTORIAL: List of Files to be hacked using Resource Hacker!
TUTORIAL: List of some Interesting Hacks, which can be made using Resource Hacker!
TUTORIAL: Changing Windows XP Login Screen Text Entries !
TUTORIAL: How to enable "VIEW" Menu on Desktop !
TUTORIAL: Add any Image in Desktop/Explorer Context Menu !
TUTORIAL: Add Your Favorite Program Shortcut in Desktop Context Menu!
TUTORIAL: Add "INSERT" Option in CD Drive Context Menu !

TUTORIAL: How to use the free space under RUN in New Windows XP Start Menu!
TUTORIAL: Change Look-n-Feel of Windows XP Start Menu
TUTORIAL: How 2 change XP Boot Screen using Tuneup Utilities!
TUTORIAL: All Kinds of Restrictions for Windows XP/2003
TUTORIAL: Hide Menubar, Addressbar & Throbber in My Computer
TUTORIAL: How to Add / Remove Entries in Context Menus
TUTORIAL: How to get FREE space in Windows?
TUTORIAL: Windows XP Services that can be Safely set to MANUAL!!!
TUTORIAL: Add DEVICE MANAGER, CONTROL PANEL, Etc. in My Computer Context Menu !
Remove Save Schemes & Other Entry from Desktop Context Menu!

TUTORIAL: How to Create Yahoo! Messenger Skins
TUTORIAL: Remove ADs from New Yahoo! Messenger 8 Final !
TUTORIAL: Change Yahoo! Messenger Default Status Messages With Your Own Messages
 
Last edited by a moderator:

rakeshishere

HELP AND SUPPORT
Awesome vishal...U seriously rock man..There was a question on this post previously but u gave us a nice solution for it...I preferably thought there might be a way u can get it done without using resource hacker..This post shud be printed in the next month's digit mag as the best tut of the month:))
 

eggman

I have Yolks not Brains!
I am new to this forum. And I saw your previous tutorials...and to be honest, they all rockkkkkk........including dis one.

Great one there, never tht it was possible to have Hibernate on the Dialog box.
 

go_gamez

In the zone
gr88 work.vishal.. u really rock...do also have tutorial..on using resource hacker..cauz i ve never used it !!sorry...i didnt do a search..but i got a tutorial..of u r s on resource hacker..
 
Last edited:

rakeshishere

HELP AND SUPPORT
Hey Hey Hey Mr vishal wait a sec..I tried the first step of the script u said which it worked well but then today i thought of trying the 2nd one and unfortunately BOOM my comp got scrwd after trying ur trick and doing a restart.I got a msg saying that the dll file does not contain the exact image of windows and so it has been corrupted..And then the next error dialog was contact the system admin for the replacement of the dll file.I tried safe mode-dint work,last known good configuration by pressing F8-dint work though i had a backup of the original dll file i had no chance/option of logging in my comp and solving the problem.I could boot but not log in so i had reinstall my whole OS and get back to normal state.
 
OP
Vishal Gupta

Vishal Gupta

Microsoft MVP
^^
The most probably reason is ur file got corrupt!
When we edit ne file using Resource Hacker, it saves the file and also create a backup of the file names "original_file_name_original.extension". So after editing the file at second time, it got corrupt.

But u could replace the backed-up file, as u mentioned u had a backup of file, by booting using XP setup CD and entering into recovery console. OR using windows 98 Setup CD or ne bootable Floppy ;)
 

rakeshishere

HELP AND SUPPORT
Vishal Gupta said:
^^
The most probably reason is ur file got corrupt!
When we edit ne file using Resource Hacker, it saves the file and also create a backup of the file names "original_file_name_original.extension". So after editing the file at second time, it got corrupt.

But u could replace the backed-up file, as u mentioned u had a backup of file, by booting using XP setup CD and entering into recovery console. OR using windows 98 Setup CD or ne bootable Floppy ;)

Well the first part what u said is absolutely right but the second part of your post didnt work at at all as i have already tried b4 making a fresh install
 

soham

In the zone
i too got the same prob. i have a back up of the file on my desktop. can anyone tell me how to replace the original file using the xp setup disk.
 
OP
Vishal Gupta

Vishal Gupta

Microsoft MVP
Guys!

by using resource hacker, we play with windows system files, and its the rule of game that sometimes we win and sometimes we loose. :D

So its very risky and we should always be prepared for such cases. I always hv an acronis image of my system drive. In case if something goes wrong, I simply restore the image. :)

@soham
Bot using XP bootable setup CD and after u get the blue screen ( When setup finishes loading drivers), press R to enter into recovery console, enter admin password and u'll get command prompt. Now u can simply replace the msgina.dll file with ur backed-up one.

U can also boot using 98 setup CD and in command prompt, u can replace the file. But it'll not work, if ur partition is NTFS.

or simply run the XP setup and select to repair the windows, it'll automatically replace the corrupt file with a new one.
 

rakeshishere

HELP AND SUPPORT
Vishal Gupta said:
Guys!

by using resource hacker, we play with windows system files, and its the rule of game that sometimes we win and sometimes we loose. :D

Very true in my case

Vishal Gupta said:
@soham
or simply run the XP setup and select to repair the windows, it'll automatically replace the corrupt file with a new one.


This doesnt work..I tried it thrice before installing a fresh copy
 
OP
Vishal Gupta

Vishal Gupta

Microsoft MVP
Mine tutorial and the other one which u posted, r quite similar but not same.
First I didnt read that tutorial and second thing is I posted the whole method and other things also, like u can change the location of the button, u can give it a label also, etc.

Its just a co-incidence that some1 also found that interesting thing. But its quite common thing coz the s/w used to get this hack was resource hacker. and ne1 who use it frequently, can find out such interesting things. :D
 
OP
Vishal Gupta

Vishal Gupta

Microsoft MVP
^^
Hibernate is a feature seen in many operating systems where the contents of RAM is written to non-volatile storage, such as the hard disk (as either a file or on a separate partition) before powering off the system. Later the system can be restored to the state it was in when hibernating, so that programs can continue executing as if nothing happened. Hibernating and restoring from hibernate is also generally faster than a cold boot and, if necessary, can be done without user interaction (unlike shutting down, which often requires the user to specify if open documents should be saved).

To use hibernation the hard disk needs to have at least as much free space as there is RAM on the system.

Hibernation is often used on laptops and can generally be set to happen automatically on a low battery alarm. Early implementations of hibernation did use the BIOS but on modern systems the functionality is usually handled by the operating system. Hibernation is defined as sleeping mode S4 in the ACPI specification.
Source: Hibernate From Wikipedia
 

aditya.shevade

Console Junkie
Has anyone tried replacing the backed up file using some LIve Linux CD which allows you to access and move files within NTFS file systems? Does it work??
 

QwertyManiac

Commander in Chief
Linux Live CDS wont support writing to NTFS at all, its still in alpha/beta stage (the functionality to write to NTFS)
 

ayush_chh

Ambassador of Buzz
as usual u r the best vishal......but how to change the looks of the button, i mean that how can we change the settings that it looks like one of the button provided by windows it self
 
OP
Vishal Gupta

Vishal Gupta

Microsoft MVP
thnx buddy!

YES! U can set an image for this button but the BAD thing is that as soon as u'll move the cursor on the Hibernate button, the image will be disappeared. The reason exists in the programming of the file. When u move the cursor on the button, it comes in Hover state and in this condition it doesnt find the Hover image so the image got disappeared.

As u can see, in msgina file there r 3 different images for all other buttons, like standby, restart and shutdown (in a single image divided by separator).

For adding image to the hibernate button, simply add ur desired image in the file and then in the dialog box click on add new control and seletct BITMAP control and in caption give the same no. as of the newly added image name. Then u can simply set the image just above the hibernate button. ;)
 
Status
Not open for further replies.
Top Bottom