TUTORIAL: Enable HIBERNATE Button in Shutdown Dialog Box !

Discussion in 'Tutorials' started by Vishal Gupta, Aug 20, 2006.

Thread Status:
Not open for further replies.
  1. Vishal Gupta

    Vishal Gupta Microsoft MVP

    Joined:
    Jul 28, 2005
    Messages:
    5,173
    Likes Received:
    121
    Trophy Points:
    0
    Location:
    AskVG.com
    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) :

    [​IMG]

    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) :

    [​IMG]

    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: Mar 19, 2014
    champ_rock and Netjunkie like this.
  2. rakeshishere

    rakeshishere HELP AND SUPPORT

    Joined:
    Jun 9, 2006
    Messages:
    1,604
    Likes Received:
    30
    Trophy Points:
    0
    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:))
     
  3. eggman

    eggman I have Yolks not Brains!

    Joined:
    Aug 7, 2006
    Messages:
    803
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Inside the shell
    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.
     
  4. go_gamez

    go_gamez New Member

    Joined:
    Apr 6, 2006
    Messages:
    417
    Likes Received:
    5
    Trophy Points:
    0
    Location:
    navi mumbai
    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: Aug 21, 2006
  5. rakeshishere

    rakeshishere HELP AND SUPPORT

    Joined:
    Jun 9, 2006
    Messages:
    1,604
    Likes Received:
    30
    Trophy Points:
    0
    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.
     
  6. OP
    OP
    Vishal Gupta

    Vishal Gupta Microsoft MVP

    Joined:
    Jul 28, 2005
    Messages:
    5,173
    Likes Received:
    121
    Trophy Points:
    0
    Location:
    AskVG.com
    ^^
    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 ;)
     
  7. rakeshishere

    rakeshishere HELP AND SUPPORT

    Joined:
    Jun 9, 2006
    Messages:
    1,604
    Likes Received:
    30
    Trophy Points:
    0
    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
     
  8. soham

    soham New Member

    Joined:
    May 31, 2005
    Messages:
    432
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    Jorhat, Assam.
    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.
     
  9. the.kaushik

    the.kaushik œ∑´®†¥¨ˆøπåß∂ƒ©˙∆˚¬Ω≈ ç√∫˜

    Joined:
    Aug 11, 2006
    Messages:
    1,046
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Bangalore
  10. OP
    OP
    Vishal Gupta

    Vishal Gupta Microsoft MVP

    Joined:
    Jul 28, 2005
    Messages:
    5,173
    Likes Received:
    121
    Trophy Points:
    0
    Location:
    AskVG.com
    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.
     
  11. rakeshishere

    rakeshishere HELP AND SUPPORT

    Joined:
    Jun 9, 2006
    Messages:
    1,604
    Likes Received:
    30
    Trophy Points:
    0
    Very true in my case


    This doesnt work..I tried it thrice before installing a fresh copy
     
  12. it_waaznt_me

    it_waaznt_me Coming back to life ..

    Joined:
    Nov 30, 2003
    Messages:
    2,023
    Likes Received:
    10
    Trophy Points:
    38
    Location:
    A bit closer to heaven
    Hey I read that in MSFN .. :|


    [Edit] I found the link finally . .. :D .. Here it is ..
     
  13. OP
    OP
    Vishal Gupta

    Vishal Gupta Microsoft MVP

    Joined:
    Jul 28, 2005
    Messages:
    5,173
    Likes Received:
    121
    Trophy Points:
    0
    Location:
    AskVG.com
    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
     
  14. gaurav_indian

    gaurav_indian CG Artist

    Joined:
    May 5, 2006
    Messages:
    1,455
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    New Delhi,India
    My question is what is hibernating and what are its benefits?
     
  15. OP
    OP
    Vishal Gupta

    Vishal Gupta Microsoft MVP

    Joined:
    Jul 28, 2005
    Messages:
    5,173
    Likes Received:
    121
    Trophy Points:
    0
    Location:
    AskVG.com
    ^^
    Source: Hibernate From Wikipedia
     
  16. aditya.shevade

    aditya.shevade Console Junkie

    Joined:
    Jun 29, 2006
    Messages:
    990
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    USA
    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??
     
  17. QwertyManiac

    QwertyManiac Commander in Chief

    Joined:
    Jul 17, 2005
    Messages:
    6,656
    Likes Received:
    10
    Trophy Points:
    0
    Linux Live CDS wont support writing to NTFS at all, its still in alpha/beta stage (the functionality to write to NTFS)
     
  18. aditya.shevade

    aditya.shevade Console Junkie

    Joined:
    Jun 29, 2006
    Messages:
    990
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    USA
    I have written files in my NTFS partition using Knoppix 5.0.1 DVD. Any thing I am missing here?
     
  19. ayush_chh

    ayush_chh Member

    Joined:
    Nov 25, 2005
    Messages:
    525
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bangalore
    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
     
  20. OP
    OP
    Vishal Gupta

    Vishal Gupta Microsoft MVP

    Joined:
    Jul 28, 2005
    Messages:
    5,173
    Likes Received:
    121
    Trophy Points:
    0
    Location:
    AskVG.com
    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. ;)
     
Thread Status:
Not open for further replies.

Share This Page