News:

This week IPhone 15 Pro winner is karn
You can be too a winner! Become the top poster of the week and win valuable prizes.  More details are You are not allowed to view links. Register or Login 

Main Menu

All About Resource Hacker! A Brief Tutorial - Part II

Started by charleychacko, October 08, 2006, 10:19:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

charleychacko

PART2 : ADVANCED INFORMATION


Adding ur own Resources:

Adding new Bitmaps/Icons/Cursors/AVIs:

1.) Click on Action -> Add a new Resource....
2.) Click on Open file with new resource button.
3.) Select the desired resource and click on Open button.
4.) Give Resource Type/Name/Language. (Remember: Resource Name should be different than the existing resources.)
5.) Click on Add Resource button.

Adding new Menu-items:

U can also add ur own Menu-items, like u can add extra menu (e.g., ur name) in Desktop Context Menu, etc.

1.) Goto desired menu, e.g., Menu -> 215 -> 1033, and add a line anywhere inside POPUP "" or something like that in following format:



MENUITEM "ur_desired_string", 12345, MFT_STRING, MFS_GRAYED | MFS_DEFAULT


Here:

"ur_desired_string" is the text which will be displayed on screen.
12345 is the the identifier, which must be different than other menuitems.
MFT_STRING describes that its a Menuitem with some text.
MFS_GRAYED disables our menuitem. U can also change it to MFS_ENABLED to enable it.
MFS_HILITE automatically select our menuitem. u can ignore it.
MFS_DEFAULT set our menuitem BOLD. u can also ignore it.

Actually u can only give MENUITEM "ur_desired_string", 12345 and Resource Hacker will automatically add other parts.

Adding Newly added Resources in Dialog Boxes:

Once u hv added ur own Icons/Bitmaps/AVIs, u may want to add them in dialog box so that they can be displayed when we open some dialog box (like RUN, Progress Dialog box, etc.).

1.) Goto the desired dialog box, in which u want to add ur own resource, e.g., Dialog -> 1020 -> 1033.
2.) Right-click on the dialog box and select Insert Control option.
3.) It'll open a new window, where u'll see many controls, like BITMAP, LABEL, ICON, BUTTON, SysAnimate32 (for AVIs), etc.
4.) Simply click on the desired control, like to use ur own added Bitmap click on the BITMAP control or to use ur own added AVI click on SysAnimate32 control. U can also add Date/Time control by clicking on SysDateTimePick32 control. 
5.) Don't forget to fill the Caption entry. Actually we hv to enter the resource name in Caption so that our added resource can be displayed on that place! e.g., if u hv added a Bitmap and gave it name as 401, then give 401 in Caption.
6.) Finally click on OK button & Compile the script.
7.) U can change its position on the dialog box by simply dragging it to ur desired position.


Using Scripts in Resource Hacker:

We can also use Resource Hacker from Command line w/o going thru its GUI and also can automate many repeatative tasks to save our time.

U can use the scripts in 2 forms:

1.) Single command
2.) Multiple commands

1.) Single Command:

Some useful commands with their format r as follows:



-add ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-addskip ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-addoverwrite ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-modify ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-extract ExeFileName, ResourceAddress, ResourceType, ResourceName,
-delete ExeFileName, ResultingFileName, ResourceType, ResourceName,

Here:

ExeFileName : The original file which we want to edit in Resource Hacker
ResultingFileName : The name which we want to give when we save the file.
ResourceAddress : The resource address (like Bitmap location on our HDD).
ResourceType : The resource type (like Bitmap, AVI, etc.).
ResourceName : Resource name (like 131, 1020, etc.).

EX:- ResHacker.exe -addoverwrite explorer.exe, explorer1.exe, MyImage.bmp , bitmap, 143,

2.) Multiple commands

To use script first u hv to create a script file in notepad and then give following command:



ResHacker.exe -script ScriptFileNameHere: ScriptFileName is the name of the script file which u made in notepad.

Format of a script You are not allowed to view links. Register or Login



[FILENAMES]
Exe=
SaveAs=
Log=


[COMMANDS]
-addoverwrite ResourceAddress, ResourceType, ResourceName
Here:

EXE= is the original file location
SaveAs= is the saved file location
Log= is the LOG file location which will store the log of the process

In [COMMAND] section, we give the commands which we want to execute.

U can omit the LOG entry, then Resource Hacker will automatically create a LOG file named "ResHacker.log".