T
txl2001
Unregistered / Unconfirmed
GUEST, unregistred user!
代码:
我的源代码如下:library Test;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
SysUtils,
Classes,
u_main in 'u_main.pas' {F_Main};
{$R *.RES}
EXPORTS
start;
begin
end.
主窗体代码:
unit u_main;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TF_Main = class(TForm)
Button1: TButton;
procedure LockedMouse(Rect: TRect;Bz:Boolean);
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure start(Sender:Tobject);stdcall ;
private
{ Private declarations }
public
{ Public declarations }
end;
var
F_Main: TF_Main;
implementation
{$R *.DFM}
procedure TF_Main.start(Sender:Tobject);stdcall ;
begin
application.CreateForm (TF_Main,f_main);
end;
procedure TF_Main.LockedMouse(Rect: TRect;Bz:Boolean);
var
Temp:integer;
Rect1:Trect;
begin
if Bz=true then
begin
rect1.Left:=rect.Left;
Rect1.Top:=rect.Top;
Rect1.Bottom:=rect.Bottom;
Rect1.Right:=rect.Right;
end
else
begin
rect1.Left:=0;
Rect1.Top:=0;
Rect1.Bottom:=screen.DesktopHeight;
Rect1.Right:=Screen.DesktopWidth;
end;
ClipCursor(@rect1);
SystemParametersInfo(spi_screensaverrunning,1,@temp,0);
end;
procedure TF_Main.Button1Click(Sender: TObject);
begin
close;
end;
procedure TF_Main.FormCreate(Sender: TObject);
var
rect:Trect;
begin
rect.Left :=F_Main.Left ;
rect.Right :=F_main.Left +F_main.Width ;
rect.Top:=f_main.Top ;
rect.Bottom :=F_main.Top +F_main.Height ;
lockedmouse(rect,true);
end;
end.
运行的时候提示找不到start ,请各位不吝赐教..