Application as a toolbar

I want to make an app will will stay 'ontop' and in the upper part of the screen but all windows, even maximized, should not ocupy the surface of my application.

Something like the Office Toolbar.
LVL 1
xtremecrisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

xtremecrisAuthor Commented:
I can make the OnTop with FormStyle, I can position the app in the upper part of the screen. But I can't figure out how to make windows not use the surface of my application(as if the desktop surface would be smaller, Office Toolbar does this).
0
geobulCommented:
Hi,

Try this:

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  rectOri: TRect;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
var
  rect: TRect;
begin
  Left := Screen.DesktopLeft;
  Top := Screen.DesktopTop;
  Width := Screen.DesktopWidth;
  Height := 50; // your form height here

  FormStyle := fsStayOnTop;

  // Get the current available work area
  SystemParametersInfo(SPI_GETWORKAREA, 0, @rectOri, 0);

  // Subtract the rect
  SubtractRect(rect, rectOri, Classes.Rect(Left, Top, Width, Height));

  // Set this to be the new available work area
  SystemParametersInfo(SPI_SETWORKAREA, 0, @rect, 0);
end;

procedure TForm1.FormDestroy(Sender: TObject);
var
  rect: TRect;
begin
  // restore rectOri
  SystemParametersInfo(SPI_SETWORKAREA, 0, @rectOri, 0);
end;

Regards, Geo
0
DragonSlayerCommented:
I would suggest creating your app as an appbar... see here for code sample: http://www.delphipages.com/tips/thread.cfm?ID=167
0
Slick812Commented:
I agree with DragonSlayer, an AppBar seems like a thing to do for this, if you do not do an AppBar, you may cover or be covered by an AppBar like Office ToolBar, , , there is also some code for this at EE question -

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20686630.html

if you do not process the AppBar notification messages, then there may be trouble?

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.