1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28:
| type TTrayAnimationType = (tatMinimize, tatMaximize);
function TrayAnimation (AForm: TForm; AType: TTrayAnimationType): Boolean; var HandleTray: HWND; RectForm, RectTray: TRect; begin result := False;
HandleTray := FindWindowEx (FindWindow ('Shell_TrayWnd', nil), 0, 'TrayNotifyWnd', nil); if (HandleTray <> 0) then if GetWindowRect (AForm.Handle, RectForm) then if GetWindowRect (HandleTray, RectTray) then case AType of tatMinimize: if DrawAnimatedRects (AForm.Handle, IDANI_CAPTION, RectForm, RectTray) then result := True; tatMaximize: if DrawAnimatedRects (AForm.Handle, IDANI_CAPTION, RectTray, RectForm) then result := True; end; end; |