H
hugh8888
Unregistered / Unconfirmed
GUEST, unregistred user!
clipcursor(@oldrect);编译这行时出错[Error] Unit1.pas(40): Undeclared identifier: 'oldrect'(30分)<br />unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls;<br><br>type<br> TForm1 = class(TForm)<br> Button1: TButton;<br> Button2: TButton;<br> procedure Button1Click(Sender: TObject);<br> procedure Button2Click(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var oldrect,rect:Trect;<br>tm:THandle;<br>begin<br>getclipcursor(oldrect);<br>tm:=form1.Handle;<br>getwindowrect(tm,rect);<br>clipcursor(@rect);<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>begin<br>clipcursor(@oldrect);<br>end;<br><br>end.