?
Solved

AppBar registration

Posted on 2000-03-21
8
Medium Priority
?
312 Views
Last Modified: 2010-04-04
How to register an application as a windows appbar (windows NT) ?

Thanks

Gustavo
0
Comment
Question by:voxel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 300 total points
ID: 2642119
hi,
this is from a p.a.q

Q: How can I register my application as a taskbar?

A: You simply can align a form to the top e.g. and set the FormStyle
      Property to fsStayOnTop, so that no app can hide yours. But
      There are at least two problems: a) some other apps or windows
      still can cover your taskbar's window when they have the same
      stay-on-top property set and b) it does not define new Desktop
      metrics, so if an application maximizes, it lays behind your
      form instead of aligning to it. So you have to register that
      form as an ordinary taskbar:

procedure RegisterTaskBarH(FormHandle: THandle; Metrics: TRect;
        Align: byte; UnRegister:boolean);
var AppStruct: TAppBarData;
begin
if UnRegister=false then begin //means you want to register a form
   with AppStruct do begin
        cbSize:=                SizeOf(AppStruct); //set record's size
        hWnd:=                  FormHandle; //e.g. Form1.Handle
        uCallBackMessage:=      WM_Activate;
        Rc:=                    Metrics;
        lParam:=                WM_Activate;
        case Align of //where shall it be placed? top, bottom...?
             tbaTop: uEdge:=    ABE_Top;
             tbaBottom: uEdge:= ABE_Bottom;
             tbaLeft: uEdge:=   ABE_Left;
             tbaRight: uEdge:=  ABE_Right;
        end;
   end;
   SHAppBarMessage(ABM_New,AppStruct); //add your form
   SHAppBarMessage(ABM_SetPos,AppStruct); //set it's position
   SHAppBarMessage(ABM_Activate,AppStruct); //activate it
   //and notify all other windows that your taskbar occupies a
   //special area (the metric bounds) on Desktop; thus they "know"
   //how far they can maximize etc.
   SHAppBarMessage(ABM_WindowPosChanged,AppStruct); //that's it!
end else begin //or we want to release our app
    with AppStruct do begin //clear parameters
         Rc:=rect(0,0,0,0);
         cbSize:=SizeOf(AppStruct);
         hWnd:=FormHandle;
         uCallBackMessage:=WM_Close;
    end;
    SHAppBarMessage(ABM_SetPos,AppStruct); //..feed functions with "nil"
    SHAppBarMessage(ABM_Activate,AppStruct);
    SHAppBarMessage(ABM_WindowPosChanged,AppStruct);
    SHAppBarMessage(ABM_Remove,AppStruct);
end;
end;


If your window shall be placed to the top of the Desktop, you would call
the procedure this way:

with Metrics do begin //type: TRect
     Left:=   0;
     Top:=    0;
     Bottom:= Screen.Width;
     Right:=  Form1.Height;
end;

RegisterTaksBarH(Form1.Handle, Metrics, tbaTop, false);


Regards Barry
0
 

Author Comment

by:voxel
ID: 2642240
I will ask your help again before give you the points.

I did it, but other windows still lay behind my appbar when they maximize.

I have then code above in the OnCreate of the bar:

procedure TForm1.FormCreate(Sender: TObject);
begin
    Self.Top := 0;
    Self.Left := 0;
    Self.Width := 800;
    Self.Height := 80;
    appbarrc.Left := 0;
    appbarrc.Top := 0;
    appbarrc.Bottom := Screen.Width;
    appbarrc.Right := Form1.Height;
    RegisterTaskBarH(Form1.Handle, appbarrc, tbaTop, false);
end;


Is something wrong ?
0
 
LVL 17

Expert Comment

by:inthe
ID: 2642363
i will do some tests to see whats wrong  becuase that should not happen .
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:voxel
ID: 2642372
Forget about the comment I posted before.

The problem is that my form window moves below the bar area together with other windows, and the bar area remains empty.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2642438
i can send you proper examples of appbar if needed.
well it's the only example i ever seen for delphi and called appbar14.zip.. maybe you have seen it before?
0
 

Author Comment

by:voxel
ID: 2642484
No, I have never heard about it. But if you can send me some examples, I would like to.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2642506
sure i'll send it ,where shall i send to ?
0
 

Author Comment

by:voxel
ID: 2642571
gustavo@camerasurf.com

ok, thanks
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question