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 listview的用法

Delphi中format函数的用法

Delphi system.net.httpclient 下载

Delphi 逐个分解后字符串加载到stringgrid1

Delphi 百万次重复调用字符分割函数,不耗内存用法

Delphi tdictionary 简单用法

Delphi 中相对路径与绝对路径函数

Delphi 生成guid算法的单元

Delphi 2009 新增单元 character[1]: toupper、tolower - 字符与字符串的大小写转换

Delphi取得网页源码内容

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



打赏

取消

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

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

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

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

评论

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