Recent

Author Topic: Position of TaskBar on Linux  (Read 4476 times)

bonmario

  • Sr. Member
  • ****
  • Posts: 346
Position of TaskBar on Linux
« on: September 01, 2008, 08:10:45 pm »
Hi at all,
in windows i use this code to detect position of windows' taskbar:

Code: [Select]
var
  hWndTaskbar: HWND;
  TaskbarRect: TRect;
begin
    { First we get the Taskbar window and it's screen position }
    hWndTaskbar := FindWindow('Shell_TrayWnd', nil);
    if hWndTaskbar = 0 then Exit;
    Windows.GetWindowRect(hWndTaskbar, @TaskbarRect);

    //Memo1.Lines.Add(TaskbarRect.Top);
    //Memo1.Lines.Add(TaskbarRect.Bottom);
    //Memo1.Lines.Add(TaskbarRect.Left);
    //Memo1.Lines.Add(TaskbarRect.Right);
end;


Someone knows how do the same on Linux???

Thanks, Mario

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
RE: Position of TaskBar on Linux
« Reply #1 on: September 05, 2008, 03:25:30 pm »
Why do you need this? I would avoid it if you can. I beliave it will be hard.

A possible solution would be creating a system tray icon with TTrayIcon and then call TTrayIcon.Position. With this position you can easely calculate the taskbar position, but you need a visible tray icon.

bonmario

  • Sr. Member
  • ****
  • Posts: 346
Re: RE: Position of TaskBar on Linux
« Reply #2 on: September 05, 2008, 07:32:13 pm »
Quote from: "sekel"
Why do you need this? I would avoid it if you can. I beliave it will be hard.

A possible solution would be creating a system tray icon with TTrayIcon and then call TTrayIcon.Position. With this position you can easely calculate the taskbar position, but you need a visible tray icon.


I want center a form in the screen and poScreenCenter don't consider the TaskBar so, on a PC with the TaskBar very high the form is not on center of the screen

 

TinyPortal © 2005-2018