delphi 移动Windows开始按钮到任务栏中的任何位置


本文整理自网络,侵删。

 开始一个新的工程,为窗体指定以下属性:

Align = top;
width = screen.width;

然后,在OnMouseMove事件中加入以下代码:

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
p: tpoint;
begin
getcursorpos(p);
movewindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil),x,y,25,25,true);
end;


运行应用程序,当你的鼠标在窗体中移动时,你会发现,开始按钮被最小化了,并随着你的鼠标移动。

试试下面的,你会对桌面上发生的事情感到高兴。

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
p: tpoint;
begin
getcursorpos(p);
movewindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'ReBarWindow32', nil),x,y,25,25,true);
end;

相关阅读 >>

Delphi firedac mysql 连接

开源Delphi组件,框架,库,资源等。

Delphi 一个线程安全的轻量级的日志类

Delphi 获取网页源代码的最简单办法

Delphi中clientdataset的用法小结

Delphi窗口随机类名

Delphi shellexecute 发送邮件

Delphi 基础计算两数之合

Delphi xe的firemonkey获取当前文件所在路径的方法

Delphi 10.3.x 截取字符串函数substring 和copy()常用字串符处理函数用法

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



打赏

取消

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

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

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

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

评论

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