[求助]我的程序有很多BMP﹐怎樣把它們做成DLL或其它格式﹖
[求助]我的程序有很多BMP﹐怎样把它们做成DLL或其它格式﹖最终只能是一个文件。做好后﹐相应的菜单文件须做怎样的变更﹖
谢谢大伙了﹗ 大侠们这几天是不是都喝酒去了! 可以用ResHacker.exe将bmp文件防到dll文件中,dll文件名必须和调用其的菜单组名同名 请cqnj023大侠详细讲解下,我下载了Resource Hacker,但不知道怎么用!怎么来达到我的目的?
回复
在Resource Hacker中可以添加bmp,并指定ID然后将dll文件放在AutoCAD搜索路径下,相应的mnu文件使用此dll如下(主要是使用bmp的ID): <b><FONT color=#ff3300>注意:</FONT></b> <FONT color=#0000ff>mymnu.mnu和mymnu.dll要同文件名</FONT>.
...
<BR>***MENUGROUP=DEVCAD
//<BR>// Begin AutoCAD Pull-down Menus<BR>//
// <BR>// 自定义菜单MENU<BR>//
// <BR>// 自定义工具条<BR>//
***TOOLBARS
**TB_TOOLBAR1<BR>ID_TOOLBAR1 <BR>ID_ToolPaletteOn ^C^C_PALETTEON<BR>ID_ToolPaletteOff ^C^C_PALETTEOFF<BR> [--]<BR>ID_DJMAP ^C^C_DJMAP<BR>ID_PJMAP ^C^C_PJMAP<BR> [--]<BR>ID_VERIFY ^C^C_VERIFY<BR> [--]<BR>ID_ROADTEXT ^C^C^P(vl-vbarun "InsertText")<BR>ID_UNITTEXT ^C^C^P(vl-vbarun "ProcessText")<BR> [--]<BR>ID_PIPELINE ^C^C^P(vl-vbarun "ZhQsMain")<BR>ID_GK&DLDW ^C^C^P(vl-vbarun "QsMain")<BR> 是不是要一个一个BMP去添加﹖我试著添加了一个﹐但是保存时没有提示是DLL﹐面是什么.rc,我有点晕了﹖ 好帖!又学了一招。 看看下面的文章吧!一个一个往里加,岂不累死人!
Commandline Scripting:
All the functionality of the Resource Hacker?GUI (apart from viewing resources) can be accessed from the commandline without having to open Resource Hacker? Commandline scripting can remove the drudgery entailed with repetitive Resource Hacker?tasks.
Commandline scripts have 2 general forms:
1. Single commands:<BR> ResHacker.exe command command_parameters<BR>2. Multiple commands:<BR> ResHacker.exe -script scriptfile
Single Commands:
command and command_parameters:<BR> -add ExeFile, SaveAsFile, ResourceFile, ResourceMask<BR> -addskip ExeFile, SaveAsFile, ResourceFile, ResourceMask<BR> -addoverwrite ExeFile, SaveAsFile, ResourceFile, ResourceMask<BR> -modify ExeFile, SaveAsFile, ResourceFile, ResourceMask<BR> -extract ExeFile, ResourceFile, ResourceMask<BR> -delete ExeFile, SaveAsFile, ResourceMask
Each command parameter must be separated by a comma, but no comma is expected before the first parameter.
If paths are not included with filenames, then the operating systems?current folder is presumed to contain the named file. It is generally good practise, though not required here, to enclose filenames contain spaces within double quotes.
The ResourceMask enables a command to be performed on either single or multiple resource items and takes the form ResType,ResName,ResLang. If ResType is a predefined type, then either its number or identifier can be used - eg the ResourceMask dialog,128,0 is identical to 5,128,0. Any or all of the ResourceMask items can be omitted - eg dialog,, indicates that all dialogs are to be applied to the command irrespective of name or language, and ,,1049<BR> indicates that all resources with Russian (1049) as the languageID will be applied to the command. An empty ResourceMask ,, indicates that the command will be applied to every resource irrespective of type, name or language.
When adding or modifying items, the ResourceFile can be a RES file for any item type, a BMP file for BITMAP types, a CUR file for CURSORGROUP types, an ICO file for ICONGROUP types, and any file type for RCDATA and user defined resource types.
When adding and modifying resources from files other than RES files then both ResType and ResName must be specified in the ResourceMask. (If ResLang is omitted then the command applies to the first language item with matching type and name, otherwise, if no matching item exists then language neutral (0) is assumed.)
When extracting resources, and more than one item is implied by the ResourceMask, then the specified ResourceFile must be either a RES file or an RC file. When binary image resources are extracted to RC files, each image is also created as a separate binary (ico, cur, bmp, gif, bin) file. See example below.
ICON and CURSOR resources cannot be manipulated directly but are added, deleted, modified, and extracted by using their respective ICONGROUP or CURSORGROUP. ICON and CURSOR can still be used but Resource Hacker?will assume ICONGROUP or CURSORGROUP was intended.
Borland抯 DFM files can also be added irrespective of whether the file is in binary or text format. However, they will always be extracted in text format. (To convert text formatted dfm files to binary format, use Borland抯 utility Convert.exe.)
All actions or errors are logged to 揜esHacker.log?
NB: If a script does not produced the desired results then check the log!
Examples: (File paths have been omitted to aid clarity)
<BR>To add or update dialog name:maindlg lang:0 in MyProg.exe from UpdDlg.res<BR> ResHacker.exe -addoverwrite MyProg.exe, MyProgNew.exe, upddlg.res, dialog,maindlg,0
To add or update bitmap name:128 in MyProg.exe from NewImage.bmp<BR> ResHacker.exe -addoverwrite MyProg.exe, MyProgNew.exe, NewImage.bmp , bitmap,128,
To add or update all bitmaps in MyProg.exe from Images.res<BR> ResHacker.exe -addoverwrite MyProg.exe, MyProgNew.exe, Images.res, bitmap,,
To add a 摇serdefined?binary resource (README,1,0) to MyProg.exe from ReadMe.html<BR> ResHacker.exe -addoverwrite MyProg.exe, MyProgNew.exe, ReadMe.html, readme,1,0
To add all items in Images.res to MyProg.exe (but fail if any item already exists)<BR> ResHacker.exe -add MyProg.exe, MyProgNew.exe, Images.res ,,,
To add all items in Images.res to MyProg.exe (skipping any existing items)<BR> ResHacker.exe -addskip MyProg.exe, MyProgNew.exe, Images.res ,,,
To modify all items in MyProg.exe with the items in Images.res (ignoring any items in Images.res which do not exist in MyProg.exe)<BR> ResHacker.exe -modify MyProg.exe, MyProgNew.exe, Images.res , , ,
To extract all icons from MyProg.exe to myprogicons.rc (creating myprogicons.rc, Icon_1.ico, Icon_2.ico , Icon_3.ico etc...)<BR> ResHacker.exe -extract MyProg.exe, myprogicons.rc, icongroup,,
To delete GIF name:128 from MyProg.exe<BR> ResHacker.exe -delete MyProg.exe, MyProgNew.exe, gif,128,
Multiple Commands:
syntax: ResHacker.exe -script ScriptFile<BR>ScriptFile is a text file with the following layout:
//comments are preceeded by double slashes<BR> <BR> Exe=<BR> SaveAs=<BR> Log=
<BR> -add ResourceSrc, ResourceMask<BR> -addskip ResourceSrc, ResourceMask<BR> -addoverwrite ResourceSrc, ResourceMask<BR> -addoverwrite ResourceSrc, ResourceMask<BR> -modify ResourceSrc, ResourceMask
-extract ResourceTgt, ResourceMask<BR> -delete ResourceMask
If Log is omitted then the default log - ResHacker.log - will be used.<BR>NB: If a script does not produced the desired results then check the log!
Examples:
rh_script_myprog_rus.txt -
//This script deletes all Language Neutral(0)<BR> //stringtable, menu and dialog resource items <BR> //in MyProg.exe before replacing them<BR> //with Russian(1049) items...
<BR> Exe= MyProg.exe<BR> SaveAs= MyProg_Rus.exe<BR> Log= MyProg_Rus.log
<BR> -delete MENU,,0<BR> -delete DIALOG,,0<BR> -delete STRINGTABLE,,0<BR> -add MyProg_Rus.res, MENU,,1049<BR> -add MyProg_Rus.res, DIALOG,,1049<BR> -add MyProg_Rus.res, STRINGTABLE,,1049
<BR>rh_script_myprog_upd_images.txt -
//This script updates 2 bitmaps and an<BR> //icon in MyProg.exe ...
<BR> Exe= MyProg.exe
SaveAs= MyProg_Updated.exe
<BR> -addoverwrite Bitmap128.bmp, BITMAP,128,<BR> -addoverwrite Bitmap129.bmp, BITMAP,129,0<BR> -addoverwrite MainIcon.ico, ICONGROUP,MAINICON,0
<BR>rh_script_myprog_upd_all.txt -
//This script replaces all resources<BR> //in MyProg.exe with all the resources <BR> //in MyProgNew.res
<BR> Exe= MyProg.exe<BR> SaveAs= MyProg_Updated.exe
<BR> -delete ,,, //delete all resources before...
-add MyProgNew.res ,,, //adding all the new resources 谢谢GU_XL大侠!
E文读起来有点困难,得找个高人翻译下. 其实不做成dll也行,直接将位图放在搜索路径下就行了.