亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲自拍偷拍图区| 亚洲欧洲av在线| 色婷婷狠狠综合| 成人永久免费视频| 成人永久aaa| 91麻豆免费看片| 色乱码一区二区三区88| 91丨porny丨在线| 一本色道a无线码一区v| 丰满少妇在线播放bd日韩电影| 国产在线精品一区二区三区不卡| 国内久久精品视频| 粉嫩av一区二区三区粉嫩 | 国产成人免费视频一区| 免费在线观看成人| 国内一区二区在线| 国产98色在线|日韩| 色综合色综合色综合色综合色综合| 91免费精品国自产拍在线不卡| 91麻豆免费看| 欧美一区日本一区韩国一区| 欧美一区二区三区爱爱| 久久久国产午夜精品| 亚洲嫩草精品久久| 日本亚洲天堂网| 国产a区久久久| 色哟哟精品一区| 日韩精品一区二区三区在线观看| 久久久美女毛片| 亚洲国产一区视频| 国产一区二区三区蝌蚪| 日本精品视频一区二区| 精品久久久久久久久久久院品网| 国产三级一区二区| 亚洲电影在线播放| 国产美女精品在线| 91久久精品网| 久久久久久一二三区| 一区二区三区国产精品| 美国毛片一区二区| 91美女蜜桃在线| 久久久久久综合| 午夜精品免费在线| av亚洲精华国产精华精华| 91.麻豆视频| 中文字幕一区二区在线播放| 美女视频网站黄色亚洲| 色呦呦网站一区| 久久亚洲春色中文字幕久久久| 亚洲综合无码一区二区| 国产伦理精品不卡| 7777精品伊人久久久大香线蕉的| 国产精品高潮久久久久无| 蜜桃视频第一区免费观看| 色狠狠一区二区| 国产精品视频第一区| 另类成人小视频在线| 欧美性欧美巨大黑白大战| 国产欧美日韩卡一| 经典三级一区二区| 欧美一二三四区在线| 亚洲第一主播视频| 一本一本久久a久久精品综合麻豆| 国产亚洲精品资源在线26u| 青青草97国产精品免费观看| 在线看日韩精品电影| 中文字幕亚洲精品在线观看| 国产91对白在线观看九色| 亚洲精品在线免费观看视频| 免播放器亚洲一区| 56国语精品自产拍在线观看| 亚洲成av人片观看| 欧美精品丝袜中出| 午夜激情一区二区三区| 在线影视一区二区三区| 亚洲欧美日韩国产综合| 色狠狠综合天天综合综合| 一区二区三区在线看| 91老师片黄在线观看| 亚洲欧洲av色图| 91黄色免费观看| 亚洲成人在线观看视频| 欧美精品乱人伦久久久久久| 日韩精品亚洲一区| 日韩一区二区三区在线| 精品一区二区在线视频| 久久久综合精品| 国产精品99久| 自拍偷拍亚洲激情| 欧美做爰猛烈大尺度电影无法无天| 一区二区三区四区视频精品免费 | 国产亚洲一区二区三区四区| 国产精品一级二级三级| 中文文精品字幕一区二区| 91蜜桃免费观看视频| 亚洲超碰精品一区二区| 日韩久久免费av| 99久久婷婷国产综合精品电影| 亚洲激情校园春色| 日韩午夜激情免费电影| 国产成人精品亚洲日本在线桃色| 1区2区3区国产精品| 欧美日韩黄色影视| 国产在线国偷精品产拍免费yy| 亚洲欧美在线观看| 欧美日韩一级黄| 国产精品综合在线视频| 亚洲日本一区二区三区| 欧美一区午夜视频在线观看| 韩国欧美国产一区| 一区二区三区成人| 精品久久久影院| 日本韩国欧美一区二区三区| 免费成人美女在线观看.| 国产精品拍天天在线| 欧美另类z0zxhd电影| 成人永久免费视频| 日本特黄久久久高潮| 国产精品视频yy9299一区| 51精品视频一区二区三区| jlzzjlzz欧美大全| 久久精品免费观看| 一区二区三区视频在线看| 久久久久一区二区三区四区| 欧美亚洲一区三区| 国产不卡视频在线观看| 日产国产高清一区二区三区 | 91高清视频在线| 国产成人免费在线| 琪琪久久久久日韩精品| 亚洲激情欧美激情| 国产日韩欧美亚洲| 日韩精品中午字幕| 欧美日韩国产综合一区二区| 成人污污视频在线观看| 国内精品久久久久影院一蜜桃| 亚洲午夜电影在线| 亚洲人成影院在线观看| 欧美激情综合在线| 久久婷婷国产综合精品青草| 欧美精品三级日韩久久| 色噜噜狠狠成人网p站| 91麻豆蜜桃一区二区三区| av亚洲精华国产精华| av亚洲产国偷v产偷v自拍| 国产.欧美.日韩| 国产精品一区二区男女羞羞无遮挡| 人人精品人人爱| 日本在线不卡视频| 婷婷久久综合九色综合绿巨人 | 亚洲国产精品二十页| 精品盗摄一区二区三区| 日韩美女视频在线| 久久尤物电影视频在线观看| 精品国产第一区二区三区观看体验| 日韩一级二级三级精品视频| 欧美疯狂性受xxxxx喷水图片| 日本大香伊一区二区三区| 在线视频一区二区三| 91精品1区2区| 91精品国产全国免费观看 | 风间由美一区二区av101| 国产成人av一区二区三区在线| 国产自产高清不卡| 国产99久久久国产精品潘金| 成人av网站免费| 91蝌蚪porny| 欧美日韩视频第一区| 91麻豆精品国产91久久久使用方法| 91精品婷婷国产综合久久竹菊| 日韩一区二区三| 久久亚洲春色中文字幕久久久| 国产精品嫩草99a| 亚洲日本在线a| 日本一不卡视频| 国产精品99久久久久久宅男| 91一区一区三区| 日韩一区二区三区视频在线观看| 久久亚洲欧美国产精品乐播| 中文字幕中文字幕一区二区| 亚洲一二三级电影| 久久av资源站| 色综合天天综合色综合av| 欧美日韩国产免费| 久久精品一区二区| 亚洲黄色小视频| 国产在线播放一区| 91免费观看国产| 精品久久久久一区| 亚洲美腿欧美偷拍| 久久er99精品| 在线免费观看日本一区| 精品国产露脸精彩对白 | 欧美一级免费大片| 欧美国产精品一区二区| 亚瑟在线精品视频| 成人免费看片app下载| 欧美一区二区在线播放| 中文字幕在线不卡| 韩日精品视频一区|