本例:代碼檔案:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, OleCtrls, SHDocVw;type TForm1 = class(TForm) WebBrowser1: TWebBrowser; Button1: TButton; Button2: TButton;
問題來源: http://www.cnblogs.com/del/archive/2009/10/16/1584488.html#1727205// EnumWindows 的功能是遍曆所有頂層視窗function EnumWindows( lpEnumFunc: TFNWndEnumProc; {回呼函數指標} lParam: LPARAM {給回呼函數的參數, 它對應回呼函數的第二個參數}): BOOL; stdcall; //成功與否,
通用寄存器EAX累加(Accumulator)寄存器AX(AH、AL)常用於乘、除法和函數傳回值EBX基址(Base)寄存器BX(BH、BL)常做記憶體資料的指標, 或者說常以它為基址來訪問記憶體.ECX計數器(Counter)寄存器CX(CH、CL)常做字串和迴圈操作中的計數器EDX資料(Data)寄存器DX(DH、DL)常用於乘、除法和 I/O 指標ESI來源索引(Source Index)寄存器SI常做記憶體資料指標和源字串指標EDI目的索引(Destination
1514131211109876543210 NTIOPLOFDFIFTFSFZF AF PF CF未使用嵌套標志I/O許可權標誌佔2位溢出標志方向標志中斷允許標志單步標志符號標志零標志未使用輔助標志未使用奇偶標志未使用進位標志上表是 32 位寄存器 EFLAGS 的低 16 位.不能直接讀寫 EFLAGS, 但有些方便的指令, 如:LAHF: 讀取EFLAGS 低 8 位到 AH; SAHF 是 LAHF 的反向操作.指令 STC、CLC、CMC 分別是給 CF(進位標誌) 置位、複位、取反;
TYPE: 擷取類型大小, 對數組是擷取每個元素的大小; Test10_1.asm.386.model flat, stdcallinclude windows.incinclude kernel32.incinclude masm32.incinclude debug.incincludelib kernel32.libincludelib masm32.libincludelib debug.lib.data? v1 db ? v2 dw ? v3
URLOpenStream 和 URLDownloadToFile 類似, 都是下載檔案的 COM 函數;前者是下載到 IStream 流, 後者是直接下載到指定路徑; 不如後者使用方便.它們都聲明在 UrlMon 單元, 本例還要同時 uses ActiveX, 因為要用到 IStream 介面.function URLOpenStream( p1: IUnknown; { 介面, 不用它, 給 nil 即可 } p2: PWideChar; {
彙編指令的一般性要求: 1、兩個運算元的尺寸必須一致; 2、運算元不能同為記憶體.MOV(Move): 最常用的資料傳送指令;該指令不影響 EFlags;指令格式: (其中的 r、m、i 分別表示: 寄存器、記憶體、立即數)MOV r/m, r/m/i; Test21_1.asm.386.model flat, stdcallinclude windows.incinclude kernel32.incinclude masm32.incinclude
32 位的寄存器容量是 4 位元組, 如果記憶體中的資料都按 4*n 位元組對齊, 肯定會加快吞吐速度;但事實並非如此, 不同大小的資料可能會讓寄存器別彆扭扭地去處理, 從而降低了運行速度!如果使用對齊, 就會浪費掉一些記憶體空間; 其實這是一個需要權衡 "速度" 與 "記憶體" 得失的問題.準備使用的測試檔案:; Test11_1.asm.586.model flat, stdcallinclude windows.incinclude kernel32.incinclude
記得剛學多線程的時候, 碰到一個結構://Delphi 的文法描述PContext = ^TContext;_CONTEXT = record ContextFlags: DWORD; Dr0: DWORD; Dr1: DWORD; Dr2: DWORD; Dr3: DWORD; Dr6: DWORD; Dr7: DWORD; FloatSave: TFloatingSaveArea; SegGs: DWORD; SegFs: DWORD; SegEs: DWORD;
PTR: 指定要操作的資料尺寸; Test12_1.asm.386.model flat, stdcallinclude windows.incinclude kernel32.incinclude masm32.incinclude debug.incincludelib kernel32.libincludelib masm32.libincludelib debug.lib.data val db 11h, 22h, 33h, 44h, 55h, 66h, 7
問題來源: http://www.cnblogs.com/del/archive/2010/04/09/1708619.html#1798022問題描述 - 給出幾組數值範圍, 如:組一: 2..5組二: 3..6組三: 1..8組四: 2..10...然後從每組中選一個數字, 依次排列成一個新的數字, 需要列出所有相片順序.實現代碼:type TArr = array of array[0..1] of Byte;procedure RangeNums(arr: TArr; List:
=、EQU、TEXTEQU 功能差不多, 它們定義的符號都將在編譯前輩替換成它們指定的常量值.相比之下 EQU 更好用些.= 舉例; Test13_1.asm.386.model flat, stdcallinclude windows.incinclude kernel32.incinclude masm32.incinclude debug.incincludelib kernel32.libincludelib masm32.libincludelib debug.
由於 "棧" 是由高到低使用的, 所以新壓入的資料的位置更低.ESP 中的指標將一直指向這個新位置, 所以 ESP 中的地址資料是動態.每次 PUSH, ESP = ESP - x; 每次 POP, ESP = ESP + x;其中的 x 只能是 4 或 2, 因為 Win32 的 PUSH 只可以壓入 32 位(預設)或 16 位的資料.ESP 有個名字叫 "棧頂", 其實它指向的是棧中最低位置的資料.執行個體查看 ESP 的變化:; Test18_1.asm.386.model flat,
[地址] 是取地址指向的內容:; Test14_1.asm.386.model flat, stdcallinclude windows.incinclude kernel32.incinclude masm32.incinclude debug.incincludelib kernel32.libincludelib masm32.libincludelib debug.lib .data dwVal dd 123.codemain proc
type TArr = array of TPoint; {把數組先定義成一個類型會方便許多, 這裡僅用 TPoint 測試}{刪除動態數組指定元素的過程: 參數 arr 是數組名, 參數 Index 是要刪除的索引}procedure DeleteArrItem(var arr: TArr; Index: Integer);var Count: Cardinal;begin Count := Length(arr); if (Count = 0) or (Index = Count)
本例:代碼檔案:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids, DBGrids, DB, DBClient, StdCtrls, ExtCtrls;type TForm1 = class(TForm) Panel1: TPanel; Button1: TButton; Button2:
這還不是 TWebBrowser 控制項的屬性、方法、事件; 這和瀏覽器中 JavaScript 的 window 對象是基本一致的.window 對象是網頁指令碼中的頂層對象, 它代表網頁的視窗、或一個架構.{IHTMLWindow2 屬性:}frames //返回視窗中的架構數組location //返回視窗的 location 對象history //返回視窗的 history 對象navigator //
問題來源: http://www.cnblogs.com/del/archive/2009/01/08/1370907.html#1425544本例:代碼檔案:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, OleCtrls, SHDocVw;type TForm1 = class(TForm)
問題來源: http://www.cnblogs.com/del/archive/2009/12/18/1627110.html#1799657準備工作:1、在空白表單上添加 TreeView1 和 Button12、啟用表單的 OnCreate 事件, 啟用 TreeView 的 OnDblClick 事件全部代碼如下:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics,
Loop 是反覆執行;從哪反覆? 這要用到 "標號";反覆幾次? 把反覆的次數告訴 ECX 寄存器即可.笨辦法計算 3 * 8 = 24; Test15_1.asm.386.model flat, stdcallinclude windows.incinclude kernel32.incinclude masm32.incinclude debug.incincludelib kernel32.libincludelib masm32.libincludelib