| Код | type TSides = (sdLeft, sdRight, sdTop, sdBottom); //... function GetTaskBarSide:TSides; var TrayRect: TRect; begin if GetWindowRect(FindWindow('Shell_TrayWnd',''),TrayRect) then begin if (TrayRect.Left=0) and (TrayRect.Top=0) and (TrayRect.Bottom=Screen.Height) then Result:= sdLeft; if (TrayRect.Left>0) and (TrayRect.Top=0) then Result:= sdRight; if (TrayRect.Left=0) and (TrayRect.Top=0) and (TrayRect.Right=Screen.Width) then Result:= sdTop; if (TrayRect.Left=0) and (TrayRect.Top>0) then Result:= sdBottom; end; end; //... procedure TForm1.Button1Click(Sender: TObject); begin case GetTaskBarSide of sdLeft: Caption:='Слева!'; sdRight: Caption:='Справа!'; sdTop: Caption:='Сверху!'; sdBottom: Caption:='Снизу!'; end; end;
|
|