亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? lion-tutorial04.htm

?? 內有一些代碼
?? HTM
?? 第 1 頁 / 共 2 頁
字號:
<html>

<head>
<link rel="stylesheet" href="../../asm.css">

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Iczelion's win32 asm tutorial</title>
</head>

<body bgcolor="#FFFFFF" background="../../images/back01.jpg">
<p align="center">Tutorial 4: Painting with Text</p>
<hr size="1">
In this tutorial, we will learn how to "paint" text in the client area of a window. 
We'll also learn about device context. <br>
You can download the source code <a href="files/tut04.zip">here</a>. 
<h3> Theory:</h3>
Text in Windows is a type of GUI object.&nbsp; Each character is composed of numerous 
pixels (dots) that are lumped together into a distinct pattern. That's why it's 
called "painting" instead of "writing". Normally, you paint text in your own client 
area (actually, you can paint outside client area but that's another story).&nbsp; 
Putting text on screen in Windows is drastically different from DOS. In DOS, you 
can think of the screen in 80x25 dimension. But in Windows, the screen are shared 
by several programs. Some rules must be enforced to avoid programs writing over 
each other's screen. Windows ensures this by limiting painting area of each window 
to its own client area only. The size of client area of a window is also not constant. 
The user can change the size anytime. So you must determine the dimensions of 
your own client area dynamically. <br>
Before you can paint something on the client area, you must ask for permission 
from Windows. That's right, you don't have absolute control of the screen as you 
were in DOS anymore.&nbsp; You must ask Windows for permission to paint your own 
client area. Windows will determine the size of your client area, font, colors 
and other GDI attributes and sends a handle to device context back to your program. 
You can then use the device context as a passport to painting on your client area. 
<br>
What is a device context? It's just a data structure maintained internally by 
Windows. A device context is associated with a particular device, such as a printer 
or video display. For a video display, a device context is usually associated 
with a particular window on the display. <br>
Some of the values in the device context are graphic attributes such as colors, 
font etc. These are default values which you can change at will. They exist to 
help reduce the load from having to specify these attributes in every GDI function 
calls. <br>
You can think of a device context as a default environment prepared for you by 
Windows. You can override some default settings later if you so wish. <br>
When a program need to paint, it must obtain a handle to a device context. Normally, 
there are several ways to accomplish this. 
<ul>
  <b>call BeginPaint in response to WM_PAINT message.</b> <br>
  <b>call GetDC in response to other messages.</b> <br>
  <b>call CreateDC to create your own device context</b> 
</ul>
One thing you must remember, after you're through with the device context handle, 
you must release it during the processing of a single message. Don't obtain the 
handle in response to one message and release it in response to another. <br>
Windows posts WM_PAINT messages to a window to notify that it's now time to repaint 
its client area. Windows does not save the content of client area of a window.&nbsp; 
Instead, when a situation occurs that warrants a repaint of client area (such 
as when a window was covered by another and is just uncovered), Windows puts WM_PAINT 
message in that window's message queue. It's the responsibility of that window 
to repaint its own client area. You must gather all information about how to repaint 
your client area in the WM_PAINT section of your window procedure, so the window 
procudure can repaint the client area when WM_PAINT message arrives. <br>
Another concept you must come to terms with is the invalid rectangle. Windows 
defines an invalid rectangle as the smallest rectangular area in the client area 
that needs to be repainted. When Windows detects an invalid rectangle in the client 
area of a window , it posts WM_PAINT message to that window. In response to WM_PAINT 
message, the window can obtain a paintstruct structure which contains, among others, 
the coordinate of the invalid rectangle. You call BeginPaint in response to WM_PAINT 
message to validate the invalid rectangle. If you don't process WM_PAINT message, 
at the very least you must call DefWindowProc or ValidateRect to validate the 
invalid rectangle else Windows will repeatedly send you WM_PAINT message. <br>
Below are the steps you should perform in response to a WM_PAINT message: 
<ul>
  <b>Get a handle to device context with BeginPaint.</b> <br>
  <b>Paint the client area.</b> <br>
  <b>Release the handle to device context with EndPaint</b> 
</ul>
Note that you don't have to explicitly validate the invalid rectangle. It's automatically 
done by the BeginPaint call. Between BeginPaint-Endpaint pair, you can call any 
GDI functions to paint your client area. Nearly all of them require the handle 
to device context as a parameter. 
<h3> Content:</h3>
We will write a program that displays a text string "Win32 assembly is great and 
easy!" in the center of the client area. <br>
&nbsp; 
<blockquote><b>.386</b> <br>
  <b>.model flat,stdcall</b> <br>
  <b>option casemap:none</b> 
  <p><b>WinMain proto :DWORD,:DWORD,:DWORD,:DWORD</b> 
  <p><b>include \masm32\include\windows.inc</b> <br>
    <b>include \masm32\include\user32.inc</b> <br>
    <b>includelib \masm32\lib\user32.lib</b> <br>
    <b>include \masm32\include\kernel32.inc</b> <br>
    <b>includelib \masm32\lib\kernel32.lib</b> 
  <p><b>.DATA</b> <br>
    <b>ClassName db "SimpleWinClass",0</b> <br>
    <b>AppName&nbsp; db "Our First Window",0</b> <br>
    <b>OurText&nbsp; db "Win32 assembly is great and easy!",0</b> 
  <p><b>.DATA?</b> <br>
    <b>hInstance HINSTANCE ?</b> <br>
    <b>CommandLine LPSTR ?</b> 
  <p><b>.CODE</b> <br>
    <b>start:</b> <br>
    <b>&nbsp;&nbsp;&nbsp; invoke GetModuleHandle, NULL</b> <br>
    <b>&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp;&nbsp; hInstance,eax</b> <br>
    <b>&nbsp;&nbsp;&nbsp; invoke GetCommandLine<br>
    &nbsp;&nbsp;&nbsp;&nbsp;mov CommandLine,eax</b><br>
    <b>&nbsp;&nbsp;&nbsp; invoke WinMain, hInstance,NULL,CommandLine, SW_SHOWDEFAULT</b> 
    <br>
    <b>&nbsp;&nbsp;&nbsp; invoke ExitProcess,eax</b> 
  <p><b>WinMain proc hInst:HINSTANCE, hPrevInst:HINSTANCE, CmdLine:LPSTR, CmdShow:DWORD</b> 
    <br>
    <b>&nbsp;&nbsp;&nbsp; LOCAL wc:WNDCLASSEX</b> <br>
    <b>&nbsp;&nbsp;&nbsp; LOCAL msg:MSG</b> <br>
    <b>&nbsp;&nbsp;&nbsp; LOCAL hwnd:HWND</b> <br>
    <b>&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp; wc.cbSize,SIZEOF WNDCLASSEX</b> <br>
    <b>&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp; wc.style, CS_HREDRAW or CS_VREDRAW</b> 
    <br>
    <b>&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp; wc.lpfnWndProc, OFFSET WndProc</b> <br>
    <b>&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp; wc.cbClsExtra,NULL</b> <br>
    <b>&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp; wc.cbWndExtra,NULL</b> <br>
    <b>&nbsp;&nbsp;&nbsp; push&nbsp; hInst</b> <br>
    <b>&nbsp;&nbsp;&nbsp; pop&nbsp;&nbsp; wc.hInstance</b> <br>
    <b>&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp; wc.hbrBackground,COLOR_WINDOW+1</b> 
    <br>
    <b>&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp; wc.lpszMenuName,NULL</b> <br>
    <b>&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp; wc.lpszClassName,OFFSET ClassName</b> 
    <br>
    <b>&nbsp;&nbsp;&nbsp; invoke LoadIcon,NULL,IDI_APPLICATION</b> <br>
    <b>&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp; wc.hIcon,eax</b> <br>
    <b>&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp; wc.hIconSm,eax</b> <br>
    <b>&nbsp;&nbsp;&nbsp; invoke LoadCursor,NULL,IDC_ARROW</b> <br>
    <b>&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp; wc.hCursor,eax</b> <br>
    <b>&nbsp;&nbsp;&nbsp; invoke RegisterClassEx, addr wc</b> <br>
    <b>&nbsp;&nbsp;&nbsp; invoke CreateWindowEx,NULL,ADDR ClassName,ADDR AppName,\</b> 
    <br>
    <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,\</b> 
    <br>
    <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,\</b> 
    <br>
    <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hInst,NULL</b> 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久久久久| 国产成人自拍网| 国产精品伦一区二区三级视频| 97se亚洲国产综合自在线| 秋霞午夜鲁丝一区二区老狼| 亚洲视频1区2区| 久久免费美女视频| 欧美亚洲另类激情小说| 欧美在线一二三四区| 国产成a人亚洲| 久草中文综合在线| 久久精品二区亚洲w码| 亚洲高清免费视频| 亚洲精品福利视频网站| 亚洲色图清纯唯美| 国产精品素人一区二区| 国产拍揄自揄精品视频麻豆| 日韩欧美的一区二区| 日韩一区二区精品在线观看| 欧美精品色综合| 欧美精品久久久久久久多人混战| 欧美日本视频在线| 精品国产凹凸成av人网站| 久久精品国产99| 亚洲视频电影在线| 欧美激情中文字幕一区二区| 国产精品一区二区三区乱码| 一区二区三区四区激情| 日本一区二区三级电影在线观看| 91精品在线麻豆| 国产亚洲一本大道中文在线| 国产日韩高清在线| 国产日本亚洲高清| 亚洲一级二级在线| 日韩和欧美一区二区三区| 极品美女销魂一区二区三区免费| 午夜av区久久| 美日韩一区二区| 蜜桃视频在线一区| 九九热在线视频观看这里只有精品| 蜜臀精品久久久久久蜜臀| 日韩国产欧美一区二区三区| 激情另类小说区图片区视频区| 精品一区二区三区在线播放| 粉嫩av一区二区三区粉嫩| 91美女视频网站| 日韩亚洲电影在线| 亚洲va国产va欧美va观看| 亚洲免费观看高清在线观看| 亚洲国产精品综合小说图片区| 日韩av中文在线观看| 国产成人精品影院| 欧美日韩一区三区四区| 日韩一二在线观看| 亚洲色图色小说| 国产一区二区在线观看视频| 91黄视频在线| 中文字幕精品—区二区四季| 全国精品久久少妇| 日本二三区不卡| 久久久久成人黄色影片| 亚洲一区二区四区蜜桃| 成人午夜大片免费观看| 日韩欧美国产一二三区| 舔着乳尖日韩一区| 欧美精品日韩精品| 亚洲日本va午夜在线影院| 国产成人综合亚洲91猫咪| 欧美mv日韩mv亚洲| 久色婷婷小香蕉久久| 欧美一区二区三区视频免费播放 | 777午夜精品免费视频| 亚洲黄色性网站| 91黄色免费观看| 夜夜嗨av一区二区三区网页| 成人性生交大片免费看视频在线| 久久综合丝袜日本网| 久久99精品久久久久久久久久久久 | 性感美女久久精品| 欧美视频一区二区在线观看| 亚洲视频你懂的| 91美女在线观看| 亚洲人成在线观看一区二区| 成人高清免费在线播放| 国产农村妇女毛片精品久久麻豆| 看片的网站亚洲| 久久免费看少妇高潮| 国产乱码精品一区二区三区五月婷| 精品成a人在线观看| 老司机精品视频线观看86| 欧美色偷偷大香| 免费xxxx性欧美18vr| xf在线a精品一区二区视频网站| 国产综合一区二区| 国产精品毛片久久久久久| 日韩精品在线一区| 9i在线看片成人免费| 一区二区免费在线播放| 精品久久久久久综合日本欧美 | 久久精品人人做人人综合 | 日本免费新一区视频| 国产日韩欧美综合在线| 欧美日韩国产免费一区二区| 国产.欧美.日韩| 日本欧美一区二区| 亚洲欧美激情插| 日本一区二区电影| 久久尤物电影视频在线观看| 欧美剧情片在线观看| 91丨九色丨尤物| 国产精品一区二区久久精品爱涩 | 亚洲免费观看高清完整版在线| 精品日韩在线观看| 欧美日韩五月天| 91麻豆精东视频| 成人激情免费视频| 狠狠色丁香久久婷婷综合_中| 视频一区视频二区在线观看| 国产精品久久久久一区二区三区| 精品国产3级a| 精品少妇一区二区三区日产乱码| 色老汉av一区二区三区| 成人免费看的视频| 国产超碰在线一区| 成人免费视频国产在线观看| 国产成人8x视频一区二区| 精品一区二区三区免费| 久久精品久久综合| 毛片基地黄久久久久久天堂| 老汉av免费一区二区三区 | 色一情一伦一子一伦一区| 色美美综合视频| 欧洲一区二区三区免费视频| 91猫先生在线| 在线播放91灌醉迷j高跟美女 | 精品99一区二区| 国产亚洲一区二区三区| 亚洲视频中文字幕| 日韩成人免费看| 国产自产v一区二区三区c| 高清成人在线观看| 波多野结衣亚洲一区| 99久久久久免费精品国产| 欧洲一区二区三区免费视频| 欧美女孩性生活视频| 精品国产伦一区二区三区观看体验 | 亚洲国产视频在线| 午夜精品久久久久久| 美女脱光内衣内裤视频久久网站 | 99re66热这里只有精品3直播| 欧美日精品一区视频| 国产亚洲午夜高清国产拍精品| 一个色综合网站| eeuss鲁一区二区三区| 911精品国产一区二区在线| 中文字幕成人av| 青青草视频一区| 91蜜桃传媒精品久久久一区二区| 欧美人妇做爰xxxⅹ性高电影| 欧美国产日本韩| 日韩精品成人一区二区在线| 成人黄色在线网站| 国产喷白浆一区二区三区| 视频一区中文字幕| 91丨porny丨最新| 日韩丝袜情趣美女图片| 亚洲第四色夜色| 99久久精品情趣| 久久亚洲一区二区三区明星换脸| 亚洲最色的网站| 色av综合在线| 国产精品久久久一本精品 | 日日夜夜精品视频免费| 欧美性极品少妇| 午夜影院在线观看欧美| 91蜜桃在线免费视频| 国产精品三级在线观看| 国产一区啦啦啦在线观看| 欧美高清你懂得| 另类调教123区| 欧美精品一区视频| 国产精品一区二区黑丝| 国产精品视频看| 欧美视频自拍偷拍| 美女视频免费一区| 久久久综合激的五月天| 99久久免费精品高清特色大片| 国产精品久久久久久妇女6080| 99精品热视频| 日韩av电影免费观看高清完整版在线观看| 欧美精品视频www在线观看| 麻豆freexxxx性91精品| 久久精品在这里| 色综合久久久久网| 亚洲国产精品一区二区www在线| 欧美精品久久一区| 国产成人午夜电影网| 亚洲国产综合91精品麻豆| 欧美一级淫片007| 北岛玲一区二区三区四区|