第一种:需要引用Windows单元 ShowMessage(IntToStr(GetSystemMetrics(SM_CYSCREEN)-GetSystemMetrics(SM_CYFULLSCREEN)-GetSystemMetrics(SM_CYCAPTION))); 第二种:需要引用Windows单元 function GetSystemTaskBarHeight:Integer; var R:TRect; begin SystemParametersInfo(SPI_GETWORKARE
program onlyRunOne; uses Forms,Windows,SysUtils, Dialogs, Unit1 in 'Unit1.pas' {Form1}; {$R *.res} var myMutex:HWND; begin myMutex:=CreateMutex(nil,false,'11111'); //名称只能全系统唯一. if WaitForSingleObject(myMutex,0)<>wait_TimeOut then begin Application.I
Delphi是市场上最好的RAD工具,但是现在C++占据着主导地位,有时针对一个问题很难找到Delphi或Pascal的解决方案.可是却可能找到了一个相关的C++类.本文描述几种在Delphi代码中使用C++类的方法. Delphi is one of the greatest RAD tools on the market, but it in this currently C++-dominated world, it can sometimes be hard to find a Delp
应恢弘之约,写了一个对其发布的匿名函数动态绑定到事件的封装,代码如下: type TAnonEvent=class public class function Wrap<T1,T2>(OnEvent:T1):T2; end; { TAnonEvent } class function TAnonEvent.Wrap<T1,T2>(OnEvent: T1):T2; var Addr:Pointer; AMethod:PMethod; begin Addr:=PPointer(@OnE
在看delphi程序的时候看到aa=(a,b,c,d);这样的东西,还以为是数组,同事说是函数,呵呵,当然这两个都不屑一击,原来这样式子是在声明并付值一个枚举类型的数据.下边写下来DELPHI中枚举类型数据的介绍和使用方法.见笑..------------------------------------------------------枚举类型 Pascal程序不仅用于数值处理,还更广泛地用于处理非数值的数据.例如,性别.月份.星期几.颜色.单位名.学历.职业等.1.枚举类型的定义格式: ty