longqcc

学习永远止境,更要学会总结。本博客大多数的内容都是从网上收集而来,加上自已的一点整理。在这里特别感谢“万一”老师的分享,谢谢!

博客园 首页 新随笔 联系 管理

2013年5月18日 #

摘要: 类名 前缀 TAction act TActionList actlst TActionMainMenuBar actmmb TActionManager actmgr TActionToolBar acttb TADOCommand cmd TADOConnection con TADODataSet ds TADOQuery qry TADOSto... 阅读全文
posted @ 2013-05-18 21:26 longqcc 阅读(261) 评论(0) 推荐(0) 编辑

摘要: function GetFileSize(const FileName: string): Int64;var SR: TSearchRec;begin Result := -1; if FindFirst(FileName, faAnyFile and (not faDirectory), SR) = 0 then try Result := SR.Size; finally ... 阅读全文
posted @ 2013-05-18 21:26 longqcc 阅读(131) 评论(0) 推荐(0) 编辑

摘要: function GetPyChar(const HZ: AnsiString): string; const HZCode: array[0..25, 0..1] of Integer = ((1601, 1636), (1637, 1832), (1833, 2077), (2078, 2273), (2274, 2301), (2302, 2432), (2433, 2593), (2... 阅读全文
posted @ 2013-05-18 21:22 longqcc 阅读(214) 评论(0) 推荐(0) 编辑

摘要: var Form1: TForm1; implementation {$R *.dfm} //分割文件的函数{参数 1 是要分割的文件名; 参数 2 是要风格文件的大小, 单位是 KB} {分割后的文件名扩展名用序号替换} function SplitFile(const FileName: string; Size: Cardinal): Boolean; var fStream: T... 阅读全文
posted @ 2013-05-18 21:22 longqcc 阅读(272) 评论(0) 推荐(0) 编辑

摘要: var Form1: TForm1; implementation {$R *.dfm} uses Zlib; //压缩函数procedure Zip(var fs: TMemoryStream); var cs: TCompressionStream; ms: TMemoryStream; num: Integer; begin if not(Assigned(fs) and ... 阅读全文
posted @ 2013-05-18 21:22 longqcc 阅读(131) 评论(0) 推荐(0) 编辑

摘要: //显示窗体中所有控件的函数function GetCtrls(Control: TWinControl; List: TStringList): Boolean; var i: Integer; obj: TWinControl; begin for i := 0 to Control.ControlCount-1 do begin obj := TWinControl(Contro... 阅读全文
posted @ 2013-05-18 21:22 longqcc 阅读(174) 评论(0) 推荐(0) 编辑

摘要: 最近在做的一个软件,其中有一部分功能需要调用其它的软件来完成,而那个软件只有可执行文件,根本没有源代码,幸好,我要做的事不难,只需要在我的程序启动后,将那个软件打开,在需要的时候,对其中的一个文本矿设置一些文字,再点击一个按钮就可以了。 说到这里,相信你也有了对该功能的一些初步设想了,没错,其基本思路就是: 1)调用CreateProcess()打开目标程序。 2)用FindWindow()找到... 阅读全文
posted @ 2013-05-18 21:22 longqcc 阅读(243) 评论(0) 推荐(0) 编辑

摘要: 函数 功能 Chr 将一个有序数据转换为一个ANSI字符 Ord 将一个有序类型值转换为它的序号 Round 转换一个实型值为四舍五入后的整型值 Trunc 转换一个实型值为小数截断后的整型值 Int 返回浮点数的整数部分 IntToStr 将数值转换为字符串 IntToHex 将数值转换为十六进制数字符串 StrToInt 将字符串转换为一个整型数,如字符串... 阅读全文
posted @ 2013-05-18 21:21 longqcc 阅读(147) 评论(0) 推荐(0) 编辑

摘要: Windows 数据类型 Delphi 数据类型 描述 LPSTR PAnsiChar 字符串指针 LPCSTR PAnsiChar 字符串指针 DWORD LongWord 整数 BOOL LongBool 布尔型 PBOOL ^BOOL 指向布尔值的指针 PByte ^Byte 指向字节值的指针 PINT ^Integer 指向整数值的指针 PSingle... 阅读全文
posted @ 2013-05-18 21:20 longqcc 阅读(147) 评论(0) 推荐(0) 编辑

摘要: 虚拟键码 对应值 对应键 VK_LBUTTON 1 鼠标左键 VK_RBUTTON 2 鼠标右键 VK_CANCEL 3 Cancel VK_MBUTTON 4 鼠标中键 VK_XBUTTON1 5 VK_XBUTTON2 6 VK_BACK 8 Backspace VK_TAB 9 Tab VK_CLEAR 12 Clear VK_RETURN ... 阅读全文
posted @ 2013-05-18 21:20 longqcc 阅读(137) 评论(0) 推荐(0) 编辑

摘要: Delphi 数据类型 C/C++ ShorInt 8位有符号整数 char Byte 8位无符号整数 BYTE,unsigned short SmallInt 16位有符号整数 short Word 16位无符号整数 unsigned short Integer,LongInt 32位有符号整数 int,long Cardinal,LongWord/DWORD 32... 阅读全文
posted @ 2013-05-18 21:19 longqcc 阅读(251) 评论(0) 推荐(0) 编辑

摘要: var x,y,z: Real; begin x := 2; y := 3; { 使用 Math.Power } z := Math.Power(x, y); ShowMessage(FloatToStr(z)); //8 { 不想 uses Math, 就用 System.Exp、System.Ln } z := Exp(Ln(x) * y); Sho... 阅读全文
posted @ 2013-05-18 04:29 longqcc 阅读(214) 评论(0) 推荐(0) 编辑

摘要: 指令 参数存放位置 参数传递顺序 参数内存管理 适用地点 register CPU寄存器 从左到右 被调用者 默认,published 属性存取方法必须使用 pascal 栈 从左到右 被调用者 向后兼容 cdecl 栈 从右到左 调用者 调用 C++ 共享库 stdcall 栈 从右到左 被调用者 API 调用 safecall 栈 从右到左 被调用者 API 调用,如... 阅读全文
posted @ 2013-05-18 04:29 longqcc 阅读(152) 评论(0) 推荐(0) 编辑

摘要: function GetSubStrNum(const SubStr,Str: WideString): Integer; var pw: PWideChar; i,SubLen: Integer; begin Result := 0; pw := PWideChar(Str); SubLen := Length(SubStr); while i > 0 do begi... 阅读全文
posted @ 2013-05-18 04:26 longqcc 阅读(365) 评论(0) 推荐(0) 编辑

摘要: {给 Memo 排序的函数} procedure SortMemo(const m: TMemo); begin with TStringList.Create do begin Sorted := True; Text := m.Text; m.Text := Text; Free; end; end; 菊子曰:我在用着的博客编辑软件 阅读全文
posted @ 2013-05-18 04:25 longqcc 阅读(180) 评论(0) 推荐(0) 编辑

摘要: //10次抽样比较,这样速度会快点,不适合特别大的文件,这样容易漏比 function CompFile(const f1,f2: string): Boolean; var fs1,fs2: TFileStream; ms: TMemoryStream; i,p: Integer; b1,b2: Byte; begin Result := False; if not (FileExi... 阅读全文
posted @ 2013-05-18 03:34 longqcc 阅读(347) 评论(0) 推荐(0) 编辑

摘要: function GB2Big(GB: string): string; var Len: Integer; begin Len := Length(GB); SetLength(Result, Len); LCMapString(GetUserDefaultLCID, LCMAP_TRADITIONAL_CHINESE, PChar(GB), Len, PChar(Result), Le... 阅读全文
posted @ 2013-05-18 02:56 longqcc 阅读(226) 评论(0) 推荐(0) 编辑

摘要: {从字符串中提取单词的函数} procedure StrToWordList(str: string; var List: TStringList); var p: PChar; i: Integer; begin if List = nil then List := TStringList.Create; List.Clear; {去除重复} List.Sorted := True;... 阅读全文
posted @ 2013-05-18 02:54 longqcc 阅读(261) 评论(0) 推荐(0) 编辑

摘要: {函数} function SetScreen(x,y: Word): Boolean; var DevMode: TDeviceMode; begin Result := EnumDisplaySettings(nil, 0, DevMode); if Result then begin DevMode.dmFields := DM_PELSWIDTH or DM_PELSHEIG... 阅读全文
posted @ 2013-05-18 02:47 longqcc 阅读(232) 评论(0) 推荐(0) 编辑

摘要: //分割字符串 ExtractStringsvar s: String; List: TStringList; begin s := 'about: #delphi; #pascal, programming'; List := TStringList.Create; ExtractStrings([';',',',':'],['#',' '],PChar(s),List); //第一... 阅读全文
posted @ 2013-05-18 02:21 longqcc 阅读(165) 评论(0) 推荐(0) 编辑