發表文章

目前顯示的是有「Forums」標籤的文章

delphi 請問Timer如果不用拉元件產生的,該如何寫

type   TDBThread = class(TThread)   protected     procedure PrintMsg;     procedure Execute; override;   end; procedure TDBThread.Execute; begin   while Not Terminated do   begin     Synchronize(PrintMsg);     Sleep(1500);   end; end; procedure TDBThread.PrintMsg; begin   Form1.Memo1.Lines.Add(TimeToStr(Time) + ': Threading'); end; procedure TForm1.FormShow(Sender: TObject); begin   DBThread := TDBThread.Create(False); end; procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); begin   DBThread.Terminate;   DBThread.WaitFor;   DBThread.Free; end; 攪個直執行緒Sleep(1500);就是你要它多久做一次(準一點 )

delphi runtime 取得panel下的可視元件 savetofile

delphi runtime 取得panel下的可視元件 procedure TForm1.AddToTreeView(ATreeNode: TTreeNode; APanel: TPanel); var   i: integer;   TmpTreeNode: TTreeNode; begin   for i := 0 to APanel.ControlCount - 1 do   begin     TmpTreeNode := TreeView1.Items.AddChild(ATreeNode, APanel.Controls[i].Name);     if APanel.Controls[i] is TPanel then      AddToTreeView(TmpTreeNode, TPanel(APanel.Controls[i]))   end; end; procedure TForm1.Button1Click(Sender: TObject); var   i: integer;   tn, TmpTreeNode: TTreeNode; begin   tn := TreeView1.Items.Add(nil, Panel1.Caption);   for i := 0 to Panel1.ControlCount - 1 do   begin     TmpTreeNode := TreeView1.Items.AddChild(tn, Panel1.Controls[i].Name);     if Panel1.Controls[i] is TPanel then     begin      AddToTreeView(TmpTreeNode, TPanel...

Resizing Controls at run time

delphi runtime design library delphi runtime library MFC CRectTracker Resizing Controls at run time http://www.codeproject.com/Articles/7771/Limit-CRectTracker-handles http://www.codeproject.com/Articles/856/Resizing-Controls-at-run-time TStretchHandle http://www.torry.net/quicksearchd.php?String=tstretchhandle&Title=Yes http://delphimaster.net/view/4-1125138258/all http://neftali.clubdelphi.com/?p=269 The Runtime Design System Suite By Kazuhiro Sasaki. http://users.utcluj.ro/~ciplea/delphi/componente/objectinspectors.html Runtime Design System v.2.2 FWS 1051 Kb 27 May 1999 By Kazuhiro Sasaki. At runtime, your application users can do Moving Controls, Resizeing Controls, Deleting Controls, Creating Controls, Changing Property in the Object Inspector, Saving Controls and Loading Controls if you use the Runtime Design System. Moreover, you hardly need to do programming. Fully functional Source: Included Exe-demo included Download: D3 D4 ht...

delphi 如何實現動態物件

delphi 如何實現動態物件   有什方法可以在不知到物件數目的情況下 在執行時期動態產生物件 就像是ValArray一樣可以變大變小 1.宣告動態陣列, 例: edt: array of TEdit;  2.設定動態陣列的長度, 例: SetLength(edt, 10); 3.動態 create 元件, 例: var   i: integer;    begin   for i := 0 to 9 do   begin     edt[i] := TEdit.Create;     edt[i].Parent := Form1;     edt[i].Left := ...;     edt[i].Top := ...;   end; end;    SetLength(edt, 10);  它適合""非物件""的動態ㄝ 我看它的原始碼是利用記憶體抓取的方法 我有查到有一種物件TObjectList不知到這個行不行 或是更上層的Tlist也市不錯用的      我想會出現記憶體錯誤的情形在於重設陣列大小之前 還必須手動將不要用的 TEdit Free 掉    TObjectList 也是個很好的選擇!    就是要如何釋放掉ㄋ 用TEdit[i].free OR TEdit[i].Destroy OR SetLength(TEdit,0) OR freeMem(@TEdit) OR...... 前三種都是過嚕會出現"無效指標" edt[i].Free; edt[i] := nil; 或 FreeAndNil(edt[i]);

delphi 由滑鼠座標取得所在座標的字元位置

delphi 由滑鼠座標取得所在座標的字元位置  1) richedit  由滑鼠座標取得所在座標的字元位置 (為了讓richedit在被dorpdrag時達到拖曳到插入貼上) 2) richedit 不行輸入TAB怎辦 >1) >richedit  >由滑鼠座標取得所在座標的字元位置 >(為了讓richedit在被dorpdrag時達到拖曳到插入貼上)    TRichEdit.GetCaretPos 函式可達到   >2) >richedit 不行輸入TAB怎辦    RichEdit1.WantTab := True;

delphi 取得不定物件的所有屬性 執行時期 如何取得 物件有哪一些 物件的屬性跟事件

delphi  取得不定物件的所有屬性   執行時期 如何取得 物件有哪一些 物件的屬性跟事件 http://delphi.ktop.com.tw/topic.asp?topic_id=24453 delphi rtti GetPropList properties

Microsoft fax implementation

要怎樣呼叫The Microsoft fax client COM implementation interfaces 或者有人可以告訴我FAX程式 或是有Component 或是.....  用 TurboPower 套件 , 內有 Fax 相關元件 網址: http://sourceforge.net/projects/tpapro/    tpapro_4_06.zip 解壓後有個 examples 目錄 http://sourceforge.net/projects/tpapro/ TurboPower Async Professional ~~~~ Brought to you by: tpsfadmin examples 目錄下的 delphi 目錄有個 FaxServer.dpr Microsoft send fax PowerShell Windows Fax server http://www.codeproject.com/Articles/120638/G-Modem-Internet- Windows 2000/XP offers two possibilities to send faxes programmatically, either by a COM-Object (faxcom.dll) or by an API (winfax.dll). The COM object also can be used in script languages like JScript, however, it isn't so flexible as the API. Through the API on the other hand you receive control over the sending process during sending. To be able to send faxes by a web page, I have written an ISAPI extension using the Fax-API. To use the fax API you must use the corresponding he...

有關delphi輸入法 與系統 快速鍵 把Ctrl+SPACE關掉

[HKEY_USERS\.DEFAULT\Control Panel\Input Method] "Show Status"="1" [HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot Keys] [HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot Keys\00000010] "Key Modifiers"=hex:02,c0,00,00 "Target IME"=hex:00,00,00,00 "Virtual Key"=hex:20,00,00,00 [HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot Keys\00000011] "Key Modifiers"=hex:04,c0,00,00 "Target IME"=hex:00,00,00,00 "Virtual Key"=hex:20,00,00,00 [HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot Keys\00000012] "Key Modifiers"=hex:02,c0,00,00 "Target IME"=hex:00,00,00,00 "Virtual Key"=hex:be,00,00,00 [HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot Keys\00000070] "Key Modifiers"=hex:02,c0,00,00 "Target IME"=hex:00,00,00,00 "Virtual Key"=hex:20,00,00,00 [HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot ...

如何抓取中斷 com port被中斷 Delphi + MSComm control serial port transceiver procedures communication

如何抓取中斷  com port被中斷 直接用 API 的話,  可以參考范逸之、陳立元編著的< >一書 元件的話有微軟附的 MSComm(這個要 Import ActiveX)、SPComm 等 小弟則是用 TurboPower 的 TApdComport 元件 https://msdn.microsoft.com/en-us/library/aa259405(v=vs.60).aspx / / Delphi + MSComm control serial port transceiver procedures  / / HotPower@126.com.  to procedure TForm1.FormCreate (Sender: TObject);  begin  if MSComm1.PortOpen then MSComm1.PortOpen: = false ;/ / close the port  MSComm1.CommPort: = 2 ;/ / set port 2  Receive buffer MSComm1.InBufferSize: = 256 ;/ / set to 256 bytes  MSComm1.OutBufferSize: = 256 ;/ / set the transmit buffer is 256 bytes  MSComm1.Settings: = '9600, n, 8,1 ';/ / 9600 baud rate, no parity, 8 data bits, 1 stop bit  MSComm1.InputLen: = 0 ;/ / read the entire contents of the buffer (32 bytes)  MSComm1.InBufferCount: = 0 ;/ / clear the receive buffer  MSComm1.OutBufferCount: = 0 ;/ / clear to send buffer  MS...

delphi 對dos 撈資料 對dos 貼資料 form http://hp.vector.co.jp/authors/VA003525/Jindex.htm

 對dos 撈資料form http://hp.vector.co.jp/authors/VA003525/Jindex.htm procedure TForm1.Button1Click(Sender: TObject); var StartupInfo: TStartupInfo;     ProcessInfo: TProcessInformation;     hRead, hWrite: THandle;     Buff: array[0..4095] of Char;     BuffSize, Len: Integer; begin      CreatePipe(hRead, hWrite, nil, 0);      FillChar(StartupInfo, Sizeof(StartupInfo), 0);      with StartupInfo do begin      cb := Sizeof(StartupInfo);      dwFlags := STARTF_USESTDHANDLES or STARTF_USESHOWWINDOW;      hStdOutput := hWrite;      wShowWindow := SW_HIDE;      end;      if CreateProcess('\Windows\Command\Attrib.exe', nil, nil, nil,      True, 0, nil, nil, StartupInfo, ProcessInfo) then begin      while WaitForSingleObject(ProcessInfo.hProcess, 500) = WA...

delphi 把檔案拖到已經在執行中的程式???

procedure TForm1.WMDropFiles(var Msg: TWMDropFiles); var   I: integer;   S: string; begin   with Msg do   begin     { Calling DragQueryFile with the file number as -1 ($FFFFFFFF) will return      the number of files which were dropped on the form. }     for I := 0 to DragQueryFile(Drop, $FFFFFFFF, nil, 0) - 1 do     begin      { Here we call DragQueryFile for each file dropped specifying a buffer      length of zero the determine the number of characters needed for the      filename, and then use SetLength to allocate the proper amount of space.      Note that we must add one to the value returned by DragQueryFile to      leave room for the null-terminator. }      SetLength(S, DragQueryFile(Drop, I, nil, 0)+1);    ...