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

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

?? lion-tutorial10.htm

?? 內有一些代碼
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<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 10: Dialog Box as Main Window</p>
<hr size="1">
Now comes the really interesting part about GUI, the dialog box. In this tutorial 
(and the next), we will learn how to use a dialog box as our main window. 
<p>Download the first example <a href="files/tut10-1.zip">here</a>, the second 
  example <a href="files/tut10-2.zip">here</a>. 
<h3> Theory:</h3>
If you play with the examples in the previous tutorial long enough, you 'll find 
out that you cannot change input focus from one child window control to another 
with Tab key. The only way you can do that is by clicking the control you want 
it to gain input focus. This situation is rather cumbersome. Another thing you 
might notice is that I changed the background color of the parent window to gray 
instead of normal white as in previous examples. This is done so that the color 
of the child window controls can blend seamlessly with the color of the client 
area of the parent window. There is a way to get around this problem but it's 
not easy. You have to subclass all child window controls in your parent window. 
<br>
The reason why such inconvenience exists is that child window controls are originally 
designed to work with a dialog box, not a normal window. The default color of 
child window controls such as a button is gray because the client area of a dialog 
box is normally gray so they blend into each other without any sweat on the programmer's 
part. <br>
Before we get deep into the detail, we should know first what a dialog box is. 
A dialog box is nothing more than a normal window which is designed to work with 
child window controls. Windows also provides internal "dialog box manager" which 
is responsible for most of the keyboard logic such as shifting input focus when 
the user presses Tab, pressing the default pushbutton if Enter key is pressed, 
etc so programmers can deal with higher level tasks. Dialog boxes are primarily 
used as input/output devices. As such a dialog box can be considered as an input/output 
"black box" meaning that you don't have to know how a dialog box works internally 
in order to be able to use it, you only have to know how to interact with it. 
That's a principle of object oriented programming (OOP) called information hiding. 
If the black box is *perfectly* designed, the user can make use of it without 
any knowledge on how it operates. The catch is that the black box must be perfect, 
that's hard to achieve in the real world. Win32 API is also designed as a black 
box too. <br>
Well, it seems we stray from our path. Let's get back to our subject. Dialog boxes 
are designed to reduce workload of a programmer. Normally if you put child window 
controls on a normal window, you have to subclass them and write keyboard logic 
yourself. But if you put them on a dialog box, it will handle the logic for you. 
You only have to know how to get the user input from the dialog box or how to 
send commands to it. <br>
A dialog box is defined as a resource much the same way as a menu. You write a 
dialog box template describing the characteristics of the dialog box and its controls 
and then compile the resource script with a resource editor. <br>
Note that all resources are put together in the same resource script file. You 
can use any text editor to write a dialog box template but I don't recommend it. 
You should use a resource editor to do the job visually since arranging child 
window controls on a dialog box is hard to do manually. Several excellent resource 
editors are available. Most of the major compiler suites include their own resource 
editors. You can use them to create a resource script for your program and then 
cut out irrelevant lines such as those related to MFC. <br>
There are two main types of dialog box: modal and modeless. A modeless dialog 
box lets you change input focus to other window. The example is the Find dialog 
of MS Word. There are two subtypes of modal dialog box: application modal and 
system modal. An application modal dialog box doesn't let you change input focus 
to other window in the same application but you can change the input focus to 
the window of <b>OTHER</b> application. A system modal dialog box doesn't allow 
you to change input focus to any other window until you respond to it first. <br>
A modeless dialog box is created by calling CreateDialogParam API function. A 
modal dialog box is created by calling DialogBoxParam. The only distinction between 
an application modal dialog box and a system modal one is the DS_SYSMODAL style. 
If you include DS_SYSMODAL style in a dialog box template, that dialog box will 
be a system modal one. <br>
You can communicate with any child window control on a dialog box by using SendDlgItemMessage 
function. Its syntax is like this: <br>
&nbsp; 
<blockquote><b>SendDlgItemMessage proto hwndDlg: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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  idControl: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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  uMsg: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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  wParam: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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  lParam:DWORD</b></blockquote>
This API call is immensely useful for interacting with a child window control. 
For example, if you want to get the text from an edit control, you can do this: 
<blockquote><b>call SendDlgItemMessage, hDlg, ID_EDITBOX, WM_GETTEXT, 256, ADDR 
  text_buffer</b></blockquote>
In order to know which message to send, you should consult your Win32 API reference. 
<br>
Windows also provides several control-specific API functions to get and set data 
quickly, for example, GetDlgItemText, CheckDlgButton etc. These control-specific 
functions are provided for programmer's convenience so he doesn't have to look 
up the meanings of wParam and lParam for each message. Normally, you should use 
control-specific API calls when they're available since they make source code 
maintenance easier. Resort to SendDlgItemMessage only if no control-specific API 
calls are available. <br>
The Windows dialog box manager sends some messages to a specialized callback function 
called a dialog box procedure which has the following format: 
<blockquote><b>DlgProc&nbsp; proto hDlg: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; 
  iMsg: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; 
  wParam: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; 
  lParam:DWORD</b></blockquote>
The dialog box procedure is very similar to a window procedure except for the 
type of return value which is TRUE/FALSE instead of LRESULT. The internal dialog 
box manager inside Windows <b>IS</b> the true window procedure for the dialog 
box. It calls our dialog box procedure with some messages that it received. So 
the general rule of thumb is that: if our dialog box procedure processes a message,it 
<b>MUST</b> return TRUE in eax and if it does not process the message, it must 
return FALSE in eax. Note that a dialog box procedure doesn't pass the messages 
it does not process to the DefWindowProc call since it's not a real window procedure. 
<br>
There are two distinct uses of a dialog box. You can use it as the main window 
of your application or use it as an input device. We 'll examine the first approach 
in this tutorial. <br>
"Using a dialog box as main window" can be interpreted in two different senses. 
<ol>
  <li> You can use the dialog box template as a class template which you register 
    with RegisterClassEx call. In this case, the dialog box behaves like a "normal" 
    window: it receives messages via a window procedure referred to by lpfnWndProc 
    member of the window class, not via a dialog box procedure. The benefit of 
    this approach is that you don't have to create child window controls yourself, 
    Windows creates them for you when the dialog box is created. Also Windows 
    handles the keyboard logic for you such as Tab order etc. Plus you can specify 
    the cursor and icon of your window in the window class structure.</li>
  <br>
  Your program just creates the dialog box without creating any parent window. 
  This approach makes a message loop unnecessary since the messages are sent directly 
  to the dialog box procedure. You don't even have to register a window class! 
</ol>
This tutorial is going to be a long one. I'll present the first approach followed 
by the second. 
<h3> Examples:</h3>
<hr width="100%">
<center>
  <b>dialog.asm</b> 
</center>
<hr width="100%">
<br>
<b>.386</b> <br>
<b>.model flat,stdcall</b> <br>
<b>option casemap:none</b> <br>
<b>WinMain proto :DWORD,:DWORD,:DWORD,:DWORD</b> <br>
<b>include \masm32\include\windows.inc</b> <br>
<b>include \masm32\include\user32.inc</b> <br>
<b>include \masm32\include\kernel32.inc</b> <br>
<b>includelib \masm32\lib\user32.lib</b> <br>
<b>includelib \masm32\lib\kernel32.lib</b> 
<p><b>.data</b> <br>
  <b>ClassName db "DLGCLASS",0</b> <br>
  <b>MenuName db "MyMenu",0</b> <br>
  <b>DlgName db "MyDialog",0</b> <br>
  <b>AppName db "Our First Dialog Box",0</b> <br>
  <b>TestString db "Wow! I'm in an edit box now",0</b> 
<p><b>.data?</b> <br>
  <b>hInstance HINSTANCE ?</b> <br>
  <b>CommandLine LPSTR ?</b> <br>
  <b>buffer db 512 dup(?)</b> 
<p><b>.const</b> <br>
  <b>IDC_EDIT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; equ 3000</b> <br>
  <b>IDC_BUTTON&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; equ 3001</b> <br>
  <b>IDC_EXIT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; equ 3002</b> <br>
  <b>IDM_GETTEXT&nbsp;&nbsp;&nbsp;&nbsp; equ 32000</b> <br>
  <b>IDM_CLEAR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; equ 32001</b> <br>
  <b>IDM_EXIT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; equ 32002</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 hDlg: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,DLGWINDOWEXTRA</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_BTNFACE+1</b> <br>
  <b>&nbsp;&nbsp;&nbsp; mov&nbsp;&nbsp; wc.lpszMenuName,OFFSET MenuName</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 CreateDialogParam,hInstance,ADDR DlgName,NULL,NULL,NULL</b> 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜精品网| 91美女在线观看| 欧美成人性战久久| 奇米在线7777在线精品 | 亚洲午夜久久久久久久久电影院| 91丨九色丨蝌蚪富婆spa| 亚洲激情在线激情| 欧美视频三区在线播放| 午夜精品久久久久影视| 精品伦理精品一区| 成人av网址在线观看| 亚洲欧美另类小说视频| 欧美探花视频资源| 久久精品国产久精国产爱| 亚洲精品一区二区三区精华液| 国产精品18久久久久久久久| 国产精品久久一级| 精品视频一区 二区 三区| 激情小说亚洲一区| 日韩一区欧美小说| 欧美日韩精品综合在线| 国内不卡的二区三区中文字幕| 久久久电影一区二区三区| 91丨porny丨蝌蚪视频| 日韩专区欧美专区| 国产三级精品三级| 欧美一区二区三区免费大片 | 国产综合久久久久久久久久久久| 国产精品入口麻豆九色| 欧美午夜精品一区二区三区| 狠狠色综合日日| 一区二区三区欧美视频| 日韩精品最新网址| 色呦呦一区二区三区| 久久福利视频一区二区| 亚洲卡通欧美制服中文| 日韩视频免费观看高清完整版 | 一区av在线播放| 久久在线免费观看| 欧美色爱综合网| 床上的激情91.| 亚洲成年人网站在线观看| 亚洲精品在线免费观看视频| 欧美色精品在线视频| 丰满白嫩尤物一区二区| 日韩av不卡一区二区| 亚洲天堂福利av| 国产欧美一区二区三区在线看蜜臀 | 国产精品免费视频观看| 香蕉久久一区二区不卡无毒影院| 国产精品自拍毛片| 久久久高清一区二区三区| 欧美色国产精品| av一区二区三区| 国产一区 二区| 青草国产精品久久久久久| 亚洲欧美日韩一区| 亚洲国产成人午夜在线一区| 日韩免费高清av| 制服丝袜亚洲精品中文字幕| 欧美视频一区二区三区| 色伊人久久综合中文字幕| 成人av免费网站| 成人激情小说乱人伦| 国产一区二区三区免费观看| 精品一区二区影视| 美美哒免费高清在线观看视频一区二区| 亚洲精选在线视频| 欧美国产日韩在线观看| 久久综合久久综合久久综合| 色婷婷久久一区二区三区麻豆| aa级大片欧美| 国产午夜亚洲精品午夜鲁丝片| 蜜臀99久久精品久久久久久软件| 亚洲三级在线免费观看| 久久久一区二区| 久久久久久久久久久黄色| 69精品人人人人| 日韩视频不卡中文| 91精品国产入口| 91精品国产美女浴室洗澡无遮挡| 欧美自拍丝袜亚洲| 欧美美女bb生活片| 日本高清不卡一区| 欧美午夜一区二区三区免费大片| 99久久国产综合色|国产精品| 成人深夜视频在线观看| 日本不卡的三区四区五区| 亚洲成人综合网站| 亚洲精品免费在线观看| 亚洲精品视频一区| 亚洲欧洲成人自拍| 亚洲视频在线一区观看| 国产欧美日韩三区| 久久精品人人做人人综合| 中文在线一区二区| 一区在线观看视频| 亚洲国产精品久久久久婷婷884| 午夜精品福利视频网站| 国产午夜精品一区二区| 在线亚洲免费视频| 狠狠狠色丁香婷婷综合激情| 久久天天做天天爱综合色| 欧美三级一区二区| av亚洲精华国产精华| 成人永久aaa| 国产日韩欧美激情| 国产丝袜美腿一区二区三区| 国产精品网站导航| 欧美成人猛片aaaaaaa| 久久精品网站免费观看| 一区免费观看视频| 偷偷要91色婷婷| 在线观看91av| 久久精品夜夜夜夜久久| 国产午夜三级一区二区三| 国产校园另类小说区| 国产乱码一区二区三区| 午夜av一区二区| 美女看a上一区| 97精品超碰一区二区三区| 欧美色电影在线| 欧美激情自拍偷拍| 亚洲视频 欧洲视频| 欧美96一区二区免费视频| 国产露脸91国语对白| 一本久久综合亚洲鲁鲁五月天| 欧美亚洲一区二区三区四区| 欧美一区二区免费视频| 亚洲国产岛国毛片在线| 国产精品成人在线观看| 日韩av不卡一区二区| 99国产精品99久久久久久| 粉嫩13p一区二区三区| 日韩一级精品视频在线观看| 日韩欧美国产不卡| 亚洲视频一二三| 国产成a人无v码亚洲福利| 欧美日韩精品系列| 欧美午夜寂寞影院| 91影院在线免费观看| 欧美专区日韩专区| 国产精品五月天| 天天综合色天天综合色h| 麻豆国产精品视频| 91在线高清观看| 欧美国产丝袜视频| 日本美女一区二区三区| 精品视频一区二区三区免费| 国产清纯白嫩初高生在线观看91| 九九视频精品免费| 欧美午夜视频网站| 一区二区三区在线免费| 久久不见久久见免费视频7| 欧美性淫爽ww久久久久无| 国产欧美一区二区三区鸳鸯浴 | 99精品欧美一区二区三区小说| 欧美日韩免费一区二区三区| 亚洲女同女同女同女同女同69| 经典三级一区二区| 欧美一卡2卡三卡4卡5免费| 亚洲欧美一区二区三区孕妇| 成人免费毛片a| 久久久久9999亚洲精品| 国产成人无遮挡在线视频| 56国语精品自产拍在线观看| 夜夜操天天操亚洲| 色嗨嗨av一区二区三区| 国产精品久久久久久久蜜臀| 成人av电影免费在线播放| 精品福利二区三区| 国产尤物一区二区| 精品少妇一区二区三区免费观看| 精品无人区卡一卡二卡三乱码免费卡| 欧美日韩在线播放三区四区| 亚洲成人午夜电影| 欧美视频完全免费看| 奇米精品一区二区三区在线观看一| 欧美久久久久久久久中文字幕| 亚洲精品成人天堂一二三| 欧美午夜精品久久久久久超碰| 一区二区三区四区蜜桃| 欧美日韩中文字幕一区| 亚洲男女一区二区三区| 欧美性猛交xxxxxx富婆| 亚洲精品成a人| 欧美福利视频导航| 亚洲一区二区高清| 欧美一区二区三区在线电影| 久久97超碰国产精品超碰| 精品美女在线观看| 99在线精品免费| 亚洲精品五月天| 日韩精品一区二| 国产精品一区在线观看乱码| 伊人开心综合网| 欧美精三区欧美精三区| 蜜臀av一区二区在线免费观看 | 韩国女主播成人在线| 欧美不卡一区二区三区|