function UpperCase(const S: string): string; overload; //参数:要转换的字符(英文字符); 例子: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,StrUtils; type TForm1 = class(TForm) Edit1: TEdit; Button1: TButton; Label...
结构体与类的定义使用的关键字不同,分别是:record、class。 type {使用record定义一个结构体} MyRecord = record {定义结构体的属性} name: String; {定义结构体的过程} procedure showName; {定义结构体的方法} function getName(): String; end; {使用class定义一个类} MyClass = class {定义类的属性} ...
记得我是在delphi2005里面看到Record可以和Class一样定义方法(Function、Procedure)的,最近几年不像年轻时太爱看语言新特性了。Delphi XE2将正则表达式加入到了系统,成为体系的一部分 System.RegularExpressions,但是它表现出来的是TRegEx记录,对,是记录,不是类,也许是为了效率考虑,之后也从没有看过实现,虽然我们大家都知...
调用API、使用 TThread 类; 线程同步(临界区,互斥,信号量); WaitForSingleObject 一、在 Delphi 中使用多线程有两种方法: 调用 API、使用 TThread 类; 使用 API 的代码更简单. 1、调用 API:CreateThread() function CreateThread( lpThreadAttributes: Pointer; {安全设置} dwStackSize: DWORD; {堆栈大小} lpStar...
end; var Form1: TForm1; implementation {$R *.dfm} function CreateClass(const AClassName : string):TObject;//根据名字生成 var tm : TObject; t : TFormClass; begin t := TFormClass(FindClass(AClassName)); tm := t.Create(nil); Result := tm; end; procedure GetBaseClassInfo(AClass :...
function EjectDll(pid:cardinal;Dll:string):Cardinal; type PDebugModule = ^TDebugModule; TDebugModule = packed record Reserved: array [0..1] of Cardinal; Base: Cardinal; Size: Cardinal; Flags: Cardinal; Index: Word; Unknown: Word; LoadCount: Word; ModuleNameOffset: Word; ImageName: array...
TPropData = packed record PropCount: Word; // 本结构中的Prob数目 {PropList: array[1..PropCount] of TPropInfo} end; 结构其中就包括一个PropCount,还有一个不定长名叫PropList的数组,数组里面是一个个设定class具体到微的TPropInfo结构。
TLanguages = class ... function LocalesCallback(LocaleID: PChar): Integer; stdcall; ... end; 显然,我们是无法将 LocalesCallback 这个方法直接传递给 EnumSystemLocales 的,因为 LocalesCallback 的函数形式声明实际上是: function LocalesCallback(Self: TLanguages; LocaleID: PChar): Integer; stdcall;...
PROCESS_DATA = packed record bCreate: DWORD; dwProcessId: DWORD; { full process's image file path } szProcessName: array[0..IMAGE_FILE_PATH_LEN - 1] of AnsiChar; end; 在这里,我们定义了三个控制码:IOCTL_SET_NOTIFY使得驱动开始踪进程的创建和销毁;IOCTL_REMOVE_NOTIFY的作用正好与IOCTL_SET_...
private 访问类别符 (class) procedure 声明 program 程序结构 property 声明 protected 访问类别符 (类) public 访问类别符 (类) published 访问类别符 (类) raise 语句 (异常处理) read 属性类别符 readonly dispatch 界面类别符 record 类型 register 函数调用协定 ...