Tuesday, 15 June 2010

delphi - How to make a form align to the edge of the screen like the taskbar? -


I am creating a "dashboard" application that looks always with any side of any monitor, even if Only other applications max. I do not necessarily need "always at the top" (though I will) but I need to make it a part of the screen as my desktop toolbar like Windows Taskbar even when maximizing applications , The windows are within this area, so this window is always visible (and small in the desktop area).

How can I align the main form of my application on the edge of a screen?

PS - I do not need to answer all the extra gritty responses, as the screen resolution changes ... I need to know how to combine it as part of the screen ? In the first place.

You see, that uses the Windows Task Bar internally with a specific style in it Creating a window involves setting it up correctly, and then communicating with it.

This can be very complicated, but with the source some free components are available (one or the other) that are the original shell to get you started.

An example from the AppBar.pas unit of another link (which, according to the link text, is freeware with the source - I used it to create an app launcher Bar, application icon and full button with details to read from .lnk files):

  type TAppBarMessage = (abmNew, abmRemove, abmQueryPos, abmSetPos, abmGetState, AbmGetTaskBarPos, AbmActivate, abmGetAutoHideBar, abmSetAutoHideBar, abmWindowPosChanged); TAppBarEdge = (abeLeft, abeTop, abeRight, abeBottom, abeUnknown, abeFloat); ... function TAppBar.AppBarMessage (abMessage: TAppBarMessage; abEdge: TAppBarEdge; lParam: LPARAM; bRect: boolean; var rc: TRect): UINT; Var abd: TAppBarData; Get started // start apt cadet structure abd.cbSize: = sizeof (abd); Abd.hWnd: = Handle; Abd.u callback message: = WM_APPBARNOTIFY; Abd.uEdge: = Ord (abEdge); If bRect then abd.rc: = rc abd.rc: = rect (0, 0, 0, 0); Abd.lParam: = lParam; Results: = SHAppBarMessage (Ord (abMessage), abd); // If the caller has passed a rectangle, then redo the revised rectangle again, then RC: = abd.rc; End;    

No comments:

Post a Comment