给你一段代码你参考一下:
unit DLLFrm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, Calendar;
type
TDLLForm = class(TForm)
calDllCalendar: TCalendar;
procedure calDllCalendarDblClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
function ShowCalendar(AHandle:THandle;ACaption:String):TDateTime;stdcall;
implementation
{$R *.dfm}
function ShowCalendar(AHandle:THandle;ACaption:String):TDateTime;
var
DLLForm: TDLLForm;
begin
Application.Handle:=AHandle;
DLLForm:=TDLLForm.Create(Application);
try
DLLForm.Caption:=ACaption;
DLLForm.ShowModal;
Result:=DLLForm.calDllCalendar.CalendarDate;
finally
DLLForm.Free;
end;
end;
procedure TDLLForm.calDllCalendarDblClick(Sender: TObject);
begin
close;
end;
end.