⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lion-tutorial05.htm

📁 内有一些代码
💻 HTM
📖 第 1 页 / 共 2 页
字号:
  <br>
  <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RGB&nbsp;&nbsp;&nbsp; 200,200,50</b> 
  <br>
  <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; invoke SetTextColor,hdc,eax</b> 
  <br>
  <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RGB&nbsp;&nbsp;&nbsp; 0,0,255</b> 
  <br>
  <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; invoke SetBkColor,hdc,eax</b> 
  <br>
  <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; invoke TextOut,hdc,0,0,ADDR TestString,SIZEOF 
  TestString</b> <br>
  <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; invoke SelectObject,hdc, hfont</b> 
  <br>
  <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; invoke EndPaint,hWnd, ADDR ps</b> 
  <br>
  <b>&nbsp;&nbsp;&nbsp; .ELSE</b> <br>
  <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; invoke DefWindowProc,hWnd,uMsg,wParam,lParam</b> 
  <br>
  <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret</b> <br>
  <b>&nbsp;&nbsp;&nbsp; .ENDIF</b> <br>
  <b>&nbsp;&nbsp;&nbsp; xor&nbsp;&nbsp;&nbsp; eax,eax</b> <br>
  <b>&nbsp;&nbsp;&nbsp; ret</b> <br>
  <b>WndProc endp</b> 
<p><b>end start</b> <br>
  &nbsp; 
<h3> Analysis:</h3>
<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; invoke CreateFont,24,16,0,0,400,0,0,0,OEM_CHARSET,\</b> 
<br>
<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,\</b> <br>
<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
DEFAULT_QUALITY,DEFAULT_PITCH or FF_SCRIPT,\</b> <br>
<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ADDR FontName</b> 
<p>CreateFont creates a logical font that is the closest match to the given parameters 
  and the font data available. This function has more parameters than any other 
  function in Windows. It returns a handle to logical font to be used by SelectObject 
  function. We will examine its parameters in detail. 
<p><b>CreateFont proto nHeight:DWORD,\</b> <br>
  <b>&nbsp;&nbsp;&nbsp;&nbs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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  cPitchAndFamily:DWORD,\</b> <br>
  <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  lpFacename:DWORD</b> 
<p><b>nHeight</b>&nbsp;&nbsp; The desired height of the characters . 0 means use 
  default size. <br>
  <b>nWidth</b>&nbsp;&nbsp; The desired width of the characters. Normally this 
  value should be 0 which allows Windows to match the width to the height. However, 
  in our example, the default width makes the characters hard to read, so I use 
  the width of 16 instead. <br>
  <b>nEscapement&nbsp;</b>&nbsp; Specifies the orientation of the next character 
  output relative to the previous one in tenths of a degree. Normally, set to 
  0. Set to 900 to have all the characters go upward from the first character, 
  1800 to write backwards, or 2700 to write each character from the top down. 
  <br>
  <b>nOrientation</b>&nbsp;&nbsp; Specifies how much the character should be rotated 
  when output in tenths of a degree. Set to 900 to have all the characters lying 
  on their backs, 1800 for upside-down writing, etc. <br>
  <b>nWeight&nbsp;</b>&nbsp; Sets the line thickness of each character. Windows 
  defines the following sizes: 
<ul>
  <b>FW_DONTCARE&nbsp;&nbsp;&nbsp;&nbsp; equ 0</b> <br>
  <b>FW_THIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  equ 100</b> <br>
  <b>FW_EXTRALIGHT&nbsp; equ 200</b> <br>
  <b>FW_ULTRALIGHT&nbsp; equ 200</b> <br>
  <b>FW_LIGHT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  equ 300</b> <br>
  <b>FW_NORMAL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; equ 400</b> 
  <br>
  <b>FW_REGULAR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; equ 400</b> <br>
  <b>FW_MEDIUM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; equ 
  500</b> <br>
  <b>FW_SEMIBOLD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; equ 600</b> <br>
  <b>FW_DEMIBOLD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; equ 600</b> <br>
  <b>FW_BOLD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  equ 700</b> <br>
  <b>FW_EXTRABOLD&nbsp;&nbsp; equ 800</b> <br>
  <b>FW_ULTRABOLD&nbsp;&nbsp; equ 800</b> <br>
  <b>FW_HEAVY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  equ 900</b> <br>
  <b>FW_BLACK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  equ 900</b> 
</ul>
<b>cItalic</b>&nbsp;&nbsp; 0 for normal, any other value for italic characters. 
<br>
<b>cUnderline</b>&nbsp;&nbsp; 0 for normal, any other value for underlined characters. 
<br>
<b>cStrikeOut</b>&nbsp;&nbsp; 0 for normal, any other value for characters with 
a line through the center. <br>
<b>cCharSet</b>&nbsp; The character set of the font. Normally should be OEM_CHARSET 
which allows Windows to select font which is operating system-dependent. <br>
<b>cOutputPrecision</b>&nbsp; Specifies how much the selected font must be closely 
matched to the characteristics we want. Normally should be OUT_DEFAULT_PRECIS 
which defines default font mapping behavior. <br>
<b>cClipPrecision&nbsp;</b> Specifies the clipping precision. The clipping precision 
defines how to clip characters that are partially outside the clipping region. 
You should be able to get by with CLIP_DEFAULT_PRECIS which defines the default 
clipping behavior. <br>
<b>cQuality&nbsp;</b> Specifies the output quality. The output quality defines 
how carefully GDI must attempt to match the logical-font attributes to those of 
an actual physical font. There are three choices: DEFAULT_QUALITY, PROOF_QUALITY 
and&nbsp; DRAFT_QUALITY. <br>
<b>cPitchAndFamily</b>&nbsp; Specifies pitch and family of the font. You must 
combine the pitch value and the family value with "or" operator. <br>
<b>lpFacename</b>&nbsp; A pointer to a null-terminated string that specifies the 
typeface of the font. 
<p>The description above is by no means comprehensive. You should refer to your 
  Win32 API reference for more details. 
<p><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; invoke SelectObject, hdc, eax</b> 
  <br>
  <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp;&nbsp; hfont,eax</b> 
<p>After we get the handle to the logical font, we must use it to select the font 
  into the device context by calling SelectObject. SelectObject puts the new GDI 
  objects such as pens, brushs, and fonts into the device context to be used by 
  GDI functions. It returns the handle to the replaced object which we should 
  save for future SelectObject call. After SelectObject call, any text output 
  function will use the font we just selected into the device context. 
<p><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RGB&nbsp;&nbsp;&nbsp; 200,200,50</b> 
  <br>
  <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; invoke SetTextColor,hdc,eax</b> 
  <br>
  <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RGB&nbsp;&nbsp;&nbsp; 0,0,255</b> 
  <br>
  <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; invoke SetBkColor,hdc,eax</b> 
<p>Use RGB macro to create a 32-bit RGB value to be used by SetColorText and SetBkColor. 
<p><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; invoke TextOut,hdc,0,0,ADDR TestString,SIZEOF 
  TestString</b> 
<p>Call TextOut function to draw the text on the client area. The text will be 
  in the font and color we specified previously. 
<p><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; invoke SelectObject,hdc, hfont</b> 
<p>When we are through with the font, we should restore the old font back into 
  the device context. You should always restore the object that you replaced in 
  the device context. <br>
<hr size="1">
<div align="center"> This article come from Iczelion's asm page, Welcom to <a href="http://asm.yeah.net">http://asm.yeah.net</a></div>

</body>
</html>

⌨️ 快捷键说明

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