delphi 实现窗口与任务栏右下角对齐


本文整理自网络,侵删。

 
//aflarin
function SysTray_GetRect: TRect;
var
  H1, H2 : HWND;
begin
  Result:= Rect(0,0,0,0);
  H1 := FindWindow('Shell_TrayWnd', nil);
  if H1 <> 0 then
  begin
    H2 := FindWindowEx(H1, 0, 'TrayNotifyWnd', nil);
    if H2 <> 0 then
      GetWindowRect(H2, Result);
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
  SysTrayRect: TRect;
begin
  SysTrayRect:= SysTray_GetRect;
  Top:= SysTrayRect.Top - Height;
  Left:= SysTrayRect.Right - Width;
end;

相关阅读 >>

Delphi xe将图标和图像添加为资源

Delphi unigui hyperserver

Delphi图像数据压缩解压缩实例

Delphi fdlocalsql使用方法

Delphi取整函数

Delphi链接自己的主页和邮件

Delphi实现图像反色实例4种方法

Delphi使用project manager添加一个java库到你的应用程序

tidtcpclient控件中文指南

Delphi tsearchrec

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



打赏

取消

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

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

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

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

评论

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