摘要:本文转载自Top.hand《delphi的ArrayList》 本文转载自Top.hand《delphi的ArrayList》 delphi可以用Classes.TList类来实现ArrayList功能.注意:add()方法存入的类型是TPoint,所以必须根据实际类型定义好相关的指针类型. pro
阅读全文
摘要:判断头几个字节: function IsJpegFile(FileName: string): Boolean;constRightBuf : array[0..3] of Byte = ($FF,$D8,$FF,$D9);varBuf: array[0..3] of Byte;beginFillC
阅读全文
摘要:Delphi 停靠技术的应用3(两个窗体停靠成PageControl样式, 分页停靠) 因为TPageControl组件重载了TWinControl组件的DoAddDockClient和DoRemoveDockClient方法,能过自动响应停靠动作添加新的也没,而当浮动被停靠的窗口后将自动的将先前创
阅读全文
摘要:Unit Unit1; Interface Uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; Type TForm1 = Class(TForm) ReleaseScrollLockBtn: TButton; SetScrol...
阅读全文
摘要:procedure CreateURLShortcut(const ShortcutFile, URL: string); var F: TextFile; // text file begin {$I+} // ensure file i/o raises exception on error // Open new file for writing (overwrites an...
阅读全文
摘要:filepath := PathJoin(['C:', 'path1', 'path2\', 'a.doc']); // filepath = 'C:\path1\path2\a.doc' 代码: function PathJoin(const Args: array of string): string; var len: Integer; i: Integer; s: strin...
阅读全文
摘要:// http://www.outofmemory.cn function ExpandEnvironment(const strValue: string): string; var chrResult: array[0..1023] of Char; wrdReturn: DWORD; begin wrdReturn := ExpandEnvironmentStrings(PCh...
阅读全文
摘要:unit Unit1; interface usesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls, ComCtrls; type TForm1 = class(T
阅读全文
摘要:Uses TypInfo; {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var I: Integer; begin for I := 0 to ComponentCount - 1 do if IsPublishedProp(
阅读全文
摘要:TIntArray = array of Integer; function MergeArray(const ArrayA, ArrayB: TIntArray): TIntArray; var ilen: Integer; begin//Copy(intArray, iFromPos, Coun
阅读全文
摘要:心血来潮,为了实现更好的通用性和封装性,需要把类方法作为回调函数,搜得一篇好文,节选转发。命名似乎应该是MethodToCallback才合适,可惜调试时总是报错,debugging。 原文地址:http://blog.csdn.net/linzhengqun/article/details/145
阅读全文
摘要:procedure TForm29.FormCreate(Sender: TObject); begin Windows.SetParent(Self.Handle, FindWindowEx(FindWindow('Progman', nil), 0, 'shelldll_defview', nil)); end;
阅读全文
摘要:type TDelFlags = set of (dfDelBefore, dfDelAfter); //删除ms字符串中endstr子字符串前面或后面的部分字符串 procedure Delstr(var ms: String; endstr: String; Flags: TDelFlags;
阅读全文
摘要://删除整个文件夹及其下的所有文件function DelDirAll(aDir: string): Boolean; var vSearch: TSearchRec; vRet: integer; vKey: string;begin if aDir[Length(aDir)] <> '\' th
阅读全文
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,AclApi, AccCtrl, StdCtrls; type PShareIn
阅读全文