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过程类型/过程类型学习

Delphi编程之显示桌面分辨率

Delphi tstringlist自定义排序

Delphi 获取窗体坐标

Delphi 获取当前光标处颜色的例子

Delphi中initialization和finalization

Delphi twebbrowser get html source after ajax load

Delphi 内存修改的实现

Delphi richedit memo1支持中文搜索、向上查找、区分大小写

Delphi指针长度

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



打赏

取消

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

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

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

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

评论

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