- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
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;