多線程編程(6) – 從 CreateThread 說起[續四]

function CreateThread( lpThreadAttributes: Pointer; dwStackSize: DWORD; {堆棧大小} lpStartAddress: TFNThreadStartRoutine; lpParameter: Pointer; dwCreationFlags: DWORD; var lpThreadId: DWORD): THandle; stdcall;CreateThread

學習 TTreeView [9] – OnDragDrop、OnDragOver

本例:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, StdCtrls;type TForm1 = class(TForm) TreeView1: TTreeView; procedure FormCreate(Sender: TObject); procedure TreeView1

把表單客戶區映像儲存到檔案或剪下板

unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; procedure Button1Click(Sender:

學習使用資源檔[7] – 字串資源

//rc 檔案:StringTablebegin0 "AAAA"1 "BBBB"2 "CCCC"3 "DDDD"end//也可以這樣寫:StringTablebegin0,"AAAA"1,"BBBB"2,"CCCC"3,"DDDD"end//還可以這樣寫:StringTable{0,"AAAA"1,"BBBB"2,"CCCC"3,"DDDD"}{嚴格的頭可能是這樣寫: STRINGTABLE DISCARDABLE}//程式碼:unit Unit1;interfaceuses Windows,

多線程編程(7) – 從 CreateThread 說起[續五]

function CreateThread( lpThreadAttributes: Pointer; {安全設定} dwStackSize: DWORD; lpStartAddress: TFNThreadStartRoutine; lpParameter: Pointer; dwCreationFlags: DWORD; var lpThreadId: DWORD): THandle; stdcall;CreateThread 的第一個參數

多線程編程(4) – 從 CreateThread 說起[續二]

function CreateThread( lpThreadAttributes: Pointer; dwStackSize: DWORD; lpStartAddress: TFNThreadStartRoutine; lpParameter: Pointer; {入口函數的參數} dwCreationFlags: DWORD; var lpThreadId: DWORD): THandle; stdcall;線程入口函數的參數是個無類型指標(Pointer),

學習 TTreeView [8] – AlphaSort、CustomSort、SortType

本例:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, StdCtrls;type TForm1 = class(TForm) TreeView1: TTreeView; Button1: TButton; Button2: TButton; Button3: TButton;

學習使用資源檔[9] – WAVE 資源

//rc 檔案:sound1 WAVE "SoundFile1.wav"sound2 WAVE "SoundFile2.wav"//代碼:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2:

Delphi 的繪圖功能[15] – 再談文字的高度與寬度: Canvas.TextExtent

procedure TForm1.Button1Click(Sender: TObject);var str: string; wh: TSize; w,h: Integer;begin {前面用過 Canvas.TextWidth、Canvas.TextHeight} str := '萬'; w := Canvas.TextWidth(str); h := Canvas.TextHeight(str); ShowMessage(Format('寬度: %d; 高度: %d',

學習 TTreeView [10] – AutoExpand、HotTrack、ReadOnly、ShowButtons、ShowLines、ShowRoot、Indent

本例:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, StdCtrls;type TForm1 = class(TForm) TreeView1: TTreeView; CheckBox1: TCheckBox; CheckBox2: TCheckBox; CheckBox3:

多線程編程(5) – 從 CreateThread 說起[續三]

function CreateThread( lpThreadAttributes: Pointer; dwStackSize: DWORD; lpStartAddress: TFNThreadStartRoutine; {入口函數的指標} lpParameter: Pointer; dwCreationFlags: DWORD; var lpThreadId: DWORD): THandle; stdcall;到了入口函數了, 學到這個地方, 我查了一個入口函數的標準定義,

捕捉全屏映像

unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); end;var Form1:

學習使用資源檔[10] – 嵌入和提取任何類型的檔案

//下面是 Windows 支援的資源格式:RT_CURSOR = MakeIntResource(1);RT_BITMAP = MakeIntResource(2);RT_ICON = MakeIntResource(3);RT_MENU = MakeIntResource(4);RT_DIALOG = MakeIntResource(5);RT_STRING =

多線程編程(8) – 多線程同步之 CriticalSection(臨界區)

先看一段程式, 代碼檔案:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) ListBox1: TListBox; Button1: TButton; procedure FormCreate(Sender: TObject);

學習使用資源檔[8] – 關於 HInstance

//幾乎每一個提取資源的例子都用到了 HInstance, 做個對比測試:var h,a,f: Cardinal;begin h := HInstance; a := Application.Handle; f := Self.Handle; ShowMessage(IntToStr(h)); {4194304} ShowMessage(IntToStr(a)); {13107942} ShowMessage(IntToStr(f)); {4260652}end;通過測試看出:

學習 TTreeView [11] – Images、ImageIndex、SelectedIndex、StateImages、StateIndex

本例:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ImgList, ComCtrls;type TForm1 = class(TForm) TreeView1: TTreeView; ImageList1: TImageList; procedure FormCreate(Sender:

把文字輸出到螢幕

本例:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure

多線程編程(9) – 認識等待函數 WaitForSingleObject

一下子跳到等待函數 WaitForSingleObject, 是因為下面的 Mutex、Semaphore、Event、WaitableTimer 等同步手段都要使用這個函數; 不過等待函數可不止 WaitForSingleObject 它一個, 但它最簡單.function WaitForSingleObject( hHandle: THandle; {要等待的物件控點} dwMilliseconds: DWORD {等待的時間, 單位是毫秒}): DWORD;

分割圖片的例子 – 回複 “小熊寶” 的問題

問題來源: http://www.cnblogs.com/del/archive/2009/01/30/1381263.html#1439476這個例子是把一張圖片平均分成了 4 份, 順序是: 左、右、上、下; 沒使用迴圈操作, 顯得有點笨, 但容易理解.unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,

學習使用資源檔[11] – DLL 中的資源檔

本例將把一張 bmp 圖片, 以資源檔的方式嵌入 dll, 然後再調用.第一步: 建一個 DLL 工程, :然後儲存, 我這裡使用的名稱都是預設的.第二步: 建一個資源原檔案, :編輯內容如下(路徑中的檔案一定要存在):img1 BITMAP "c:\temp\test.bmp"然後, 取個名(尾碼須是 rc, 我這裡取名為 Res.rc), 儲存在工程目錄下.第三步: 在 DLL 工程中添加這個資源原檔案, :此時, 工程源檔案中會添加一句: {$R 'Res.res' 'Res.rc'},

總頁數: 61357 1 .... 4763 4764 4765 4766 4767 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.