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写qq消息群发(模拟按键精灵)

Delphi dbgrid应用

Delphi感染文件的例子

Delphi unigrid记录check遍历

Delphi str1.compare 比较两个字符是否相同

Delphi stringgrid 实例5 本例功能:字体修改为居中,红色,20号

Delphi 隐藏桌面图标和任务栏

Delphi timage 加上滚动条方法

oleinitialize和coinitialize的区别

Delphi 如何使用sendmessage发送后台组合键消息(ctrl+xxx)

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



打赏

取消

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

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

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

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

评论

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