res32.htm

来自「刚刚看到本站有Visual C++数字图象处理(人民邮电出版社)的电子书」· HTM 代码 · 共 410 行 · 第 1/2 页

HTM
410
字号
    <td>dataversion </td>

    <td>determines the format of the information within the resource header that follows. 

    reserved for future expansion.<br>

    this field is always zeroed but is supposed to change on next version of win32.<br>

    <font size="-1"><b>resource editors should check this field and maintan unchaged the 

    resource data if the format is not supported.</b></font> </td>

  </tr>

  <tr>

    <td>memoryflags </td>

    <td>contains flags about the state of the resource.<br>

    <font size="-1"><b>further explanation of this field can be found in &quot;the memoryflags 

    field&quot; chapter.</b></font> </td>

  </tr>

  <tr>

    <td>languageid </td>

    <td>specifies the language that the strings are written. by providing different values for 

    this field it is possible to store different language versions of the same resource. the 

    application can then choose the set of resources to load based on the currently system 

    language.<br>

    <font size="-1"><b>further explanation of this field can be found in &quot;language 

    ids&quot; chapter.</b></font> </td>

  </tr>

  <tr>

    <td>version </td>

    <td>this field can be used to store custom version information. this lets resource editors 

    to keep backward compatibility whith other version of the same resource editor.<br>

    <font size="-1"><b>this value is stripped out when the resource is linked to the 

    application executable file.</b></font> </td>

  </tr>

  <tr>

    <td>characteristics </td>

    <td>like the version field, this field can be used to store custom information flags.<br>

    <font size="-1"><b>this value is stripped out when the resource is linked to the 

    application executable file.</b></font> </td>

  </tr>

</table>



<p><br>

</p>



<p><b>the restype field</b><br>

<br>

the restype field can either be:<br>



<ul>

  <li>1) a number </li>

  <li>2) a null-terminated unicode string </li>

</ul>



<table border="1" bgcolor="white" cellpadding="2" cellspacing="0" width="100%">

  <tr bgcolor="black">

    <td><font color="white"><b>#</b></font> </td>

    <td><font color="white"><b>description</b></font> </td>

  </tr>

  <tr>

    <td><b>1)</b> </td>

    <td>the first word of the restype field is 0xffff and the second word contains the 

    resource type id.<br>

    the restype field is always 4 bytes long (0xffff word + id word), thus it doesn't require 

    any padding for dword boundary alignment.<br>

    this kind of restype field is used for system defined resources (menu, dialogs, icons,...) 

    but is can also be used for custom resource types.<br>

    <font size="-1"><b>if you are going to use this kind of restype for your custom resources, 

    be sure to use id values not already reserved for standard resources (i suggest you using 

    ids greater than 0x8000 or like). or better: never use non numeric ids for your custom 

    resources.</b></font><br>

    <br>

    all standard windows resource types have been assigned numeric ids as follows:<br>

    <br>

<xmp>    0x0001 = cursor 0x0002 = bitmap 0x0003 = icon 0x0004 = menu 0x0005 = dialog 0x0006 = 

    string table 0x0007 = font directory 0x0008 = font 0x0009 = accelerators table 0x000a = rc 

    data (custom binary data) 0x000b = message table 0x000c = group cursor 0x000e = group icon 

    0x0010 = version information 0x0011 = dialog include 0x0013 = plug'n'play 0x0014 = vxd 

    0x0015 = animated cursor 0x2002 = bitmap (new version) 0x2004 = menu (new version) 0x2005 

    = dialog (new version) </xmp> </td>

  </tr>

  <tr>

    <td><b>2)</b> </td>

    <td>the first word of the restype field is not 0xffff.<br>

    the restype field is an array of unicode characters (a string) terminated by a null 

    (0x0000 word). an additional word may be inserted after the terminating null to make next 

    field (resname) start on a dword boundary.<br>

    <br>

    if your application is not using the set of unicode api calls you have to convert the 

    resource name to ansi encoding.<br>

    <br>

    standard resources never use this kind of restype field. </td>

  </tr>

</table>



<p><b>the resname field</b><br>

<br>

the resname field can either be:<br>



<ul>

  <li>1) a number </li>

  <li>2) a null-terminated unicode string </li>

</ul>



<table border="1" bgcolor="white" cellpadding="2" cellspacing="0" width="100%">

  <tr bgcolor="black">

    <td><font color="white"><b>#</b></font> </td>

    <td><font color="white"><b>description</b></font> </td>

  </tr>

  <tr>

    <td><b>1)</b> </td>

    <td>the first word of the resname field is 0xffff and the second word contains the 

    resource name id.<br>

    the resname field is always 4 bytes long (0xffff word + id word), thus it doesn't require 

    any padding for dword boundary alignment.<br>

    <br>

    <b>notice: string table resources are not allowed to be named using a unicode string: they 

    must be have a numeric name id (case 1).</b> </td>

  </tr>

  <tr>

    <td><b>2)</b> </td>

    <td>the first word of the resname field is not 0xffff.<br>

    the resname field is an array of unicode characters (a string) terminated by a null 

    (0x0000 word). an additional word may be inserted after the terminating null to make next 

    field (dataversion) start on a dword boundary.<br>

    <br>

    if your application is not using the set of unicode api calls you have to convert the 

    resource name to ansi encoding.<br>

    <br>

    <b>notice: string table resources are not allowed to be named using a unicode string: they 

    must be have a numeric name id (case 1).</b> </td>

  </tr>

</table>



<p><b>the memoryflags field</b><br>

<br>

the memoryflags field contains flags about the state of a the resource.<br>

<br>

this field is a &quot;bit set&quot;, that is, each single bit of its value have a 

different meaning as follows: <br>

</p>



<table border="1" bgcolor="white" cellpadding="2" cellspacing="0" width="100%">

  <tr bgcolor="black">

    <td><font color="white"><b>bit #</b></font> </td>

    <td><font color="white"><b>bit mask</b></font> </td>

    <td><font color="white"><b>description</b></font> </td>

  </tr>

  <tr>

    <td>4 </td>

    <td>0x0010 </td>

    <td>if set: the resource is <b>moveable</b>, that is, the system can move the resource in 

    memory.<br>

    if not set: the resource is <b>fixed</b>, that is, the system cannot move the resource in 

    memory. </td>

  </tr>

  <tr>

    <td>5 </td>

    <td>0x0020 </td>

    <td>if set: the resource is <b>pure</b>, that is, the resource contains dword aligned data 

    (padding is not needed).<br>

    if not set: the resource is <b>impure</b>, that is, the resource contains non dword 

    aligned data (padding is needed). </td>

  </tr>

  <tr>

    <td>6 </td>

    <td>0x0040 </td>

    <td>if set: the resource must to be <b>preload</b>ed, that is, the resource must be loaded 

    in memory just after the application has been loaded from disk.<br>

    if not set: the resource must not be <b>preload</b>ed, that is, the resource must be 

    loaded in memory only when the application requires it. </td>

  </tr>

  <tr>

    <td>10 </td>

    <td>0x1000 </td>

    <td>if set: the resource is <b>discardable</b>, that is, on low memory conditions, the 

    resource can be removed from memory and then reloaded when the application needs it.<br>

    if not set: the resource isn't <b>discardable</b>, that is, on low memory conditions, the 

    resource cannot be removed from memory. </td>

  </tr>

</table>



<p><br>

<font size="-1"><b>notice:</b><br>

winnt ignores the setting of the moveable, impure, and preload flags. </font></p>



<p><b>language ids</b><br>

<br>

the languageid field, included in each resource header, specifies the language that the 

strings (of string tables and message tables) are written with.<br>

the system must be informed of the language because it needs to know how to convert 

characters from unicode to ansi (from double-byte to single-byte characters).<br>

<br>

the languageid field (found in any resource header) if a 16 bin unsigned integer (word) 

containing not only the language id but also a sub-language id. the lower 10 bits (bits 

0-9) of this value contain the languageid, remaining bits contain the sublanguageid (bits 

11-15).<br>

the languageid specifies the code of the primary language. the sublanguageid specifies a 

variation of the primary language (a dialect).<br>

<br>

</p>



<hr align="left">



<p><br>

win32 resource format guide v1.0 - released on october 27th, 1997 <br>

</p>

</body>

</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?