delphi spy++ 拖拽功能


本文整理自网络,侵删。

 
{$R *.dfm} 
var  h: HWND; 
     pt,p1: TPoint; 
     arr,arr1: array[0..254] of Char; 
     h1: HCURSOR; 
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton; 
  Shift: TShiftState; X, Y: Integer); 
begin 
  Timer1.Enabled:=True; 
  Image1.Picture.LoadFromFile('02.bmp'); 
 // h1:=LoadCursorFromFile('031.ico');  //031.ico 
 // SetSystemCursor(h1,ocr_normal); 
  Screen.Cursor:=crCross; 
end

procedure TForm1.Timer1Timer(Sender: TObject); 
var  p1:TPoint; 
begin 
    GetCursorPos(p1); 
    h :=WindowFromPoint(p1); 
    label1.Caption:=Format('%d,%d',[p1.X,p1.Y]); 
end

procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton; 
  Shift: TShiftState; X, Y: Integer); 
begin 
  Screen.Cursor:=crDefault; 
 Timer1.Enabled:=False; 
 Label1.Caption:=''; 
  Image1.Picture.LoadFromFile('01.bmp'); 
 // SystemParametersinfo(SPI_SETCURSORS,0,nil,SPIF_SENDCHANGE); 
  Screen.Cursor:=crDefault; 
  GetClassName(h, arr, Length(arr)); 
  GetWindowText(h, @arr1, SizeOf(arr)); 
  Edit2.Text := arr; 
  Edit1.Text:=arr1; 
end;

相关阅读 >>

Delphi 字符串分割

Delphi tms web core webmemo 横竖滚动条

Delphi xe 可用的md5算法

Delphi richedit 加入链接

Delphi string 常用字串符处理函数

Delphi tradiogroup 单选分组框组件

Delphi 关闭显示器

Delphi 利用tidencodermime tiddecodermime 组件字符串加密解密

Delphi xe 分割字符串太方便了

Delphi中用拼音首字符序列来实现检索功能

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...