Class TAppBar (unit AppBar)

Inherits from

TForm

TAppBar class ////////////////////////////////////////////////////////////

Constructors


constructor Create (Owner : TComponent);

Public member functions } // Constructs an AppBar

Public member functions } // TAppBar.



Functions

destructor Destroy;

Destroys a previously created AppBar

TAppBar.


function LoadSettings : Boolean;

Loads settings from the registry at RootKey and KeyName location.

function SaveSettings : Boolean;

Saves settings into the registry at RootKey and KeyName location.

procedure UpdateBar;

Forces the AppBar's visual appearance to match its internal state

TAppBar.


function GetEdge : TAppBarEdge;

Property selector functions } // Retrieves the AppBar's edge.

function GetEdgeFromPoint (abFlags : TAppBarFlags; pt : TSmallPoint) : TAppBarEdge;

Returns a proposed edge or ABE_FLOAT based on ABF_* flags and a point specified in screen coordinates

TAppBar.


function IsDockable (abFlags : TAppBarFlags) : Boolean;

Returns TRUE if abFlags contain an at least allowed edge to dock on

TAppBar.


function IsDockableHorizontally (abFlags : TAppBarFlags) : Boolean;

Returns TRUE if abFlags contain abfAllowTop and abfAllowBottom

TAppBar.


function IsDockableVertically (abFlags : TAppBarFlags) : Boolean;

Returns TRUE if abFlags contain abfAllowLeft and abfAllowRight

TAppBar.


function IsEdgeLeftOrRight (abEdge : TAppBarEdge) : Boolean;

AppBar-specific helper functions } // Returns TRUE if abEdge is ABE_LEFT or ABE_RIGHT, else FALSE is returned

AppBar-specific helper functions } // TAppBar.


function IsEdgeTopOrBottom (abEdge : TAppBarEdge) : Boolean;

Returns TRUE if abEdge is ABE_TOP or ABE_BOTTOM, else FALSE is returned

TAppBar.


function IsFloating (abEdge : TAppBarEdge) : Boolean;

Returns TRUE if abEdge is ABE_FLOAT, else FALSE is returned

TAppBar.


procedure OnABNFullScreenApp (bOpen : Boolean);

Called when AppBar gets an ABN_FULLSCREENAPP notification

TAppBar.


procedure OnABNPosChanged;

Called when AppBar gets an ABN_POSCHANGED notification

TAppBar.


procedure OnABNWindowArrange (bBeginning : Boolean);

Called when AppBar gets an ABN_WINDOWARRANGE notification

TAppBar.


procedure OnActivate (var Msg : TWMActivate);

Called when the AppBar receives a WM_ACTIVATE message

TAppBar.


procedure OnAppBarCallbackMsg(var Msg : TMessage);

Message handlers } // Called when the AppBar receives a WM_APPBARNOTIFY window message

Message handlers } // TAppBar.


procedure OnAppBarForcedToDocked;

Called if user attempts to dock an Autohide AppBar on an edge that already contains an Autohide AppBar

TAppBar.


procedure OnAppBarStateChange (bProposed : Boolean; abEdgeProposed : TAppBarEdge);

Overridable functions } // Called when the AppBar's proposed state changes

Overridable functions } // TAppBar.


procedure OnAppBarTimer (Sender : TObject);

Called every timer tick

TAppBar.


procedure OnCreate (var Msg: TWMCreate);

Called when the AppBar form is first created

TAppBar.


procedure OnDestroy (var Msg : TWMDestroy);

Called when the AppBar form is about to be destroyed

TAppBar.


procedure OnEnterSizeMove (var Msg : TMessage);

Called when the AppBar receives a WM_ENTERSIZEMOVE message

TAppBar.


procedure OnExitSizeMove (var Msg : TMessage);

Called when the AppBar receives a WM_EXITSIZEMOVE message

TAppBar.


procedure OnGetMinMaxInfo (var Msg : TWMGetMinMaxInfo);

Called when the AppBar receives a WM_GETMINMAXINFO message

TAppBar.


procedure OnMoving (var Msg : TMessage);

Called when the AppBar receives a WM_MOVING message

TAppBar.


procedure OnNcHitTest (var Msg: TWMNCHitTest);

Called when the AppBar receives a WM_NCHITTEST message

TAppBar.


procedure OnNcMouseMove (var Msg : TWMNCMouseMove);

Called when the AppBar receives a WM_NCMOUSEMOVE message

TAppBar.


procedure OnSizing (var Msg : TMessage);

Called when the AppBar receives a WM_SIZING message

TAppBar.


procedure OnWindowPosChanged (var Msg : TWMWindowPosChanged);

Called when the AppBar receives a WM_WINDOWPOSCHANGED message

TAppBar.


procedure ResetSystemKnowledge;

Forces the shell to update its AppBar list and the workspace area

TAppBar.


procedure SetEdge (abEdge : TAppBarEdge);

Changes the AppBar's edge to ABE_UNKNOWN, ABE_FLOAT or an ABE_edge

TAppBar.


procedure SetSlideTime (nInterval : Integer);

Changes the slide time interval

TAppBar.


function AdjustLocationForAutohide (bShow : Boolean; var rc : TRect) : Boolean;

Adjusts the AppBar's location to account for autohide Returns TRUE if rectangle was adjusted

TAppBar.


function AppBarMessage (abMessage : TAppBarMessage; abEdge : TAppBarEdge; lParam : LPARAM; bRect : Boolean; var rc : TRect) : UINT;

These functions encapsulate the shell's SHAppBarMessage function

TAppBar.


function AppBarMessage1 (abMessage : TAppBarMessage) : UINT;

TAppBar.

function AppBarMessage2 (abMessage : TAppBarMessage; abEdge : TAppBarEdge) : UINT;

TAppBar.

function AppBarMessage3 (abMessage : TAppBarMessage; abEdge : TAppBarEdge; lParam : LPARAM) : UINT;

TAppBar.

function AppBarMessage4 (abMessage : TAppBarMessage; abEdge : TAppBarEdge; lParam : LPARAM; var rc : TRect) : UINT;

TAppBar.

function CalcProposedState (var pt : TSmallPoint) : TAppBarEdge;

Gets a edge (ABE_FLOAT or ABE_edge) from a point (screen coordinates

TAppBar.


procedure CreateParams (var Params: TCreateParams);

Internal implementation functions } // Modifies window creation flags

Internal implementation functions } // TAppBar.


function GetAutohideEdge : TAppBarEdge;

Returns which edge we're autohidden on or ABE_UNKNOWN

TAppBar.


function GetMessagePosition : TSmallPoint;

Returns a TSmallPoint that gives the cursor position in screen coords

TAppBar.


procedure GetRect (abEdgeProposed : TAppBarEdge; var rcProposed : TRect);

Gets a retangle position (screen coordinates) from a proposed state

TAppBar.


function ModifyStyle (hWnd : THandle; nStyleOffset : Integer; dwRemove : DWORD; dwAdd : DWORD; nFlags : UINT) : Boolean;

Changes the style of a window (translated from AfxModifyStyle

TAppBar.


procedure ShowHiddenAppBar (bShow : Boolean);

If AppBar is Autohide and docked, shows/hides the AppBar

TAppBar.


procedure SlideWindow (var rcEnd : TRect);

When Autohide AppBar is shown/hidden, slides in/out of view

TAppBar.


Properties

property AlwaysOnTop : Boolean

Always On Top On/Off

property AutoHide : Boolean

Auto-hide On/Off

property Edge : TAppBarEdge

Edge to dock on

property Flags : TAppBarFlags

Properties } // Allowed dockable edges

property FloatBottom : Integer


property FloatLeft : Integer

AppBar coordinates when floating

property FloatRight : Integer


property FloatTop : Integer


property HorzDockSize : Integer

Horizontal size when docked on left or right

property HorzSizeInc : Integer

Horizontal size increment

property KeyName : String

KeyName in the registry where settings should be loaded/saved

property MaxHeight : Integer


property MaxHorzDockSize : Integer

Max Height when docked horizontally

property MaxVertDockSize : Integer

Max Width when docked vertically

property MaxWidth : Integer


property MinHeight : Integer


property MinHorzDockSize : Integer

Min Height when docked horizontally

property MinVertDockSize : Integer

Min Width when docked vertically

property MinWidth : Integer

AppBar MinMax dimensions when floating

property RootKey : Integer

RootKey in the registry where settings should be loaded/saved

property SlideEffect : Boolean

Slide Effect On/Off

property SlideTime : Integer

Slide Time

property TaskEntry : TAppBarTaskEntry

AppBar behavior in the Window Taskbar

property VertDockSize : Integer

Vertical size when docked on top or bottom

property VertSizeInc : Integer

Vertical size increment

Events

Variables

FabEdgeProposedPrev : TAppBarEdge;

We need a member variable which tracks the proposed edge of the AppBar while the user is moving it, deciding where to position it.

FABS : TAppBarSettings;

Internal implementation state variables } // This AppBar's settings info

FabSettingsLocation : TAppBarSettingsLocation;

We need a member variable to store the settings location in the registry

FbAutoHideIsVisible : Boolean;

We need a member variable which tracks whether our autohide window is visible or not

FbFullScreenAppOpen : Boolean;

We need a member variable which tracks whether a full screen application window is open

FTimer : TTimer;

We need a timer to to determine when the AppBar should be re-hidden


Constructors


constructor Create (Owner : TComponent);

Public member functions } // Constructs an AppBar

Public member functions } // TAppBar.Create /////////////////////////////////////////////////////////////


Functions


destructor Destroy;

Destroys a previously created AppBar

TAppBar.Destroy ////////////////////////////////////////////////////////////


function LoadSettings : Boolean;

Loads settings from the registry at RootKey and KeyName location. Returns TRUE if the settings are available, else FALSE

TAppBar.LoadSettings ///////////////////////////////////////////////////////


function SaveSettings : Boolean;

Saves settings into the registry at RootKey and KeyName location. Returns TRUE if succeeded, else FALSE

TAppBar.SaveSettings ///////////////////////////////////////////////////////


procedure UpdateBar;

Forces the AppBar's visual appearance to match its internal state

TAppBar.UpdateBar //////////////////////////////////////////////////////////


function GetEdge : TAppBarEdge;

Property selector functions } // Retrieves the AppBar's edge. If the AppBar is being positioned, its // proposed state is returned instead

Property selector functions } // TAppBar.GetEdge ////////////////////////////////////////////////////////////


function GetEdgeFromPoint (abFlags : TAppBarFlags; pt : TSmallPoint) : TAppBarEdge;

Returns a proposed edge or ABE_FLOAT based on ABF_* flags and a point specified in screen coordinates

TAppBar.GetEdgeFromPoint ///////////////////////////////////////////////////


function IsDockable (abFlags : TAppBarFlags) : Boolean;

Returns TRUE if abFlags contain an at least allowed edge to dock on

TAppBar.IsDockable /////////////////////////////////////////////////////////


function IsDockableHorizontally (abFlags : TAppBarFlags) : Boolean;

Returns TRUE if abFlags contain abfAllowTop and abfAllowBottom

TAppBar.IsDockableHorizontally /////////////////////////////////////////////


function IsDockableVertically (abFlags : TAppBarFlags) : Boolean;

Returns TRUE if abFlags contain abfAllowLeft and abfAllowRight

TAppBar.IsDockableVertically ///////////////////////////////////////////////


function IsEdgeLeftOrRight (abEdge : TAppBarEdge) : Boolean;

AppBar-specific helper functions } // Returns TRUE if abEdge is ABE_LEFT or ABE_RIGHT, else FALSE is returned

AppBar-specific helper functions } // TAppBar.IsEdgeLeftOrRight //////////////////////////////////////////////////


function IsEdgeTopOrBottom (abEdge : TAppBarEdge) : Boolean;

Returns TRUE if abEdge is ABE_TOP or ABE_BOTTOM, else FALSE is returned

TAppBar.IsEdgeTopOrBottom //////////////////////////////////////////////////


function IsFloating (abEdge : TAppBarEdge) : Boolean;

Returns TRUE if abEdge is ABE_FLOAT, else FALSE is returned

TAppBar.IsFloating /////////////////////////////////////////////////////////


procedure OnABNFullScreenApp (bOpen : Boolean);

Called when AppBar gets an ABN_FULLSCREENAPP notification

TAppBar.OnABNFullScreenApp /////////////////////////////////////////////////


procedure OnABNPosChanged;

Called when AppBar gets an ABN_POSCHANGED notification

TAppBar.OnABNPosChanged ////////////////////////////////////////////////////


procedure OnABNWindowArrange (bBeginning : Boolean);

Called when AppBar gets an ABN_WINDOWARRANGE notification

TAppBar.OnABNWindowArrange /////////////////////////////////////////////////


procedure OnActivate (var Msg : TWMActivate);

Called when the AppBar receives a WM_ACTIVATE message

TAppBar.OnActivate /////////////////////////////////////////////////////////


procedure OnAppBarCallbackMsg(var Msg : TMessage);

Message handlers } // Called when the AppBar receives a WM_APPBARNOTIFY window message

Message handlers } // TAppBar.OnAppBarCallbackMsg ////////////////////////////////////////////////


procedure OnAppBarForcedToDocked;

Called if user attempts to dock an Autohide AppBar on an edge that already contains an Autohide AppBar

TAppBar.OnAppBarForcedToDocked /////////////////////////////////////////////


procedure OnAppBarStateChange (bProposed : Boolean; abEdgeProposed : TAppBarEdge);

Overridable functions } // Called when the AppBar's proposed state changes

Overridable functions } // TAppBar.OnAppBarStateChange ////////////////////////////////////////////////


procedure OnAppBarTimer (Sender : TObject);

Called every timer tick

TAppBar.OnAppBarTimer //////////////////////////////////////////////////////


procedure OnCreate (var Msg: TWMCreate);

Called when the AppBar form is first created

TAppBar.OnCreate ///////////////////////////////////////////////////////////


procedure OnDestroy (var Msg : TWMDestroy);

Called when the AppBar form is about to be destroyed

TAppBar.OnDestroy //////////////////////////////////////////////////////////


procedure OnEnterSizeMove (var Msg : TMessage);

Called when the AppBar receives a WM_ENTERSIZEMOVE message

TAppBar.OnEnterSizeMove ////////////////////////////////////////////////////


procedure OnExitSizeMove (var Msg : TMessage);

Called when the AppBar receives a WM_EXITSIZEMOVE message

TAppBar.OnExitSizeMove /////////////////////////////////////////////////////


procedure OnGetMinMaxInfo (var Msg : TWMGetMinMaxInfo);

Called when the AppBar receives a WM_GETMINMAXINFO message

TAppBar.OnGetMinMaxInfo ////////////////////////////////////////////////////


procedure OnMoving (var Msg : TMessage);

Called when the AppBar receives a WM_MOVING message

TAppBar.OnMoving ///////////////////////////////////////////////////////////


procedure OnNcHitTest (var Msg: TWMNCHitTest);

Called when the AppBar receives a WM_NCHITTEST message

TAppBar.OnNcHitTest ////////////////////////////////////////////////////////


procedure OnNcMouseMove (var Msg : TWMNCMouseMove);

Called when the AppBar receives a WM_NCMOUSEMOVE message

TAppBar.OnNcMouseMove //////////////////////////////////////////////////////


procedure OnSizing (var Msg : TMessage);

Called when the AppBar receives a WM_SIZING message

TAppBar.OnSizing ///////////////////////////////////////////////////////////


procedure OnWindowPosChanged (var Msg : TWMWindowPosChanged);

Called when the AppBar receives a WM_WINDOWPOSCHANGED message

TAppBar.OnWindowPosChanged /////////////////////////////////////////////////


procedure ResetSystemKnowledge;

Forces the shell to update its AppBar list and the workspace area

TAppBar.ResetSystemKnowledge ///////////////////////////////////////////////


procedure SetEdge (abEdge : TAppBarEdge);

Changes the AppBar's edge to ABE_UNKNOWN, ABE_FLOAT or an ABE_edge

TAppBar.SetEdge ////////////////////////////////////////////////////////////


procedure SetSlideTime (nInterval : Integer);

Changes the slide time interval

TAppBar.SetSlideTime ///////////////////////////////////////////////////////


function AdjustLocationForAutohide (bShow : Boolean; var rc : TRect) : Boolean;

Adjusts the AppBar's location to account for autohide Returns TRUE if rectangle was adjusted

TAppBar.AdjustLocationForAutohide //////////////////////////////////////////


function AppBarMessage (abMessage : TAppBarMessage; abEdge : TAppBarEdge; lParam : LPARAM; bRect : Boolean; var rc : TRect) : UINT;

These functions encapsulate the shell's SHAppBarMessage function

TAppBar.AppBarMessage //////////////////////////////////////////////////////


function AppBarMessage1 (abMessage : TAppBarMessage) : UINT;

TAppBar.AppBarMessage1 /////////////////////////////////////////////////////


function AppBarMessage2 (abMessage : TAppBarMessage; abEdge : TAppBarEdge) : UINT;

TAppBar.AppBarMessage2 /////////////////////////////////////////////////////


function AppBarMessage3 (abMessage : TAppBarMessage; abEdge : TAppBarEdge; lParam : LPARAM) : UINT;

TAppBar.AppBarMessage3 /////////////////////////////////////////////////////


function AppBarMessage4 (abMessage : TAppBarMessage; abEdge : TAppBarEdge; lParam : LPARAM; var rc : TRect) : UINT;

TAppBar.AppBarMessage4 /////////////////////////////////////////////////////


function CalcProposedState (var pt : TSmallPoint) : TAppBarEdge;

Gets a edge (ABE_FLOAT or ABE_edge) from a point (screen coordinates

TAppBar.CalcProposedState //////////////////////////////////////////////////


procedure CreateParams (var Params: TCreateParams);

Internal implementation functions } // Modifies window creation flags

Internal implementation functions } // TAppBar.CreateParams ///////////////////////////////////////////////////////


function GetAutohideEdge : TAppBarEdge;

Returns which edge we're autohidden on or ABE_UNKNOWN

TAppBar.GetAutohideEdge ////////////////////////////////////////////////////


function GetMessagePosition : TSmallPoint;

Returns a TSmallPoint that gives the cursor position in screen coords

TAppBar.GetMessagePosition /////////////////////////////////////////////////


procedure GetRect (abEdgeProposed : TAppBarEdge; var rcProposed : TRect);

Gets a retangle position (screen coordinates) from a proposed state

TAppBar.GetRect ////////////////////////////////////////////////////////////


function ModifyStyle (hWnd : THandle; nStyleOffset : Integer; dwRemove : DWORD; dwAdd : DWORD; nFlags : UINT) : Boolean;

Changes the style of a window (translated from AfxModifyStyle

TAppBar.ModifyStyle ////////////////////////////////////////////////////////


procedure ShowHiddenAppBar (bShow : Boolean);

If AppBar is Autohide and docked, shows/hides the AppBar

TAppBar.ShowHiddenAppBar ///////////////////////////////////////////////////


procedure SlideWindow (var rcEnd : TRect);

When Autohide AppBar is shown/hidden, slides in/out of view

TAppBar.SlideWindow ////////////////////////////////////////////////////////


Properties


property AlwaysOnTop : Boolean

Always On Top On/Off


property AutoHide : Boolean

Auto-hide On/Off


property Edge : TAppBarEdge

Edge to dock on


property Flags : TAppBarFlags

Properties } // Allowed dockable edges


property FloatBottom : Integer


property FloatLeft : Integer

AppBar coordinates when floating


property FloatRight : Integer


property FloatTop : Integer


property HorzDockSize : Integer

Horizontal size when docked on left or right


property HorzSizeInc : Integer

Horizontal size increment


property KeyName : String

KeyName in the registry where settings should be loaded/saved


property MaxHeight : Integer


property MaxHorzDockSize : Integer

Max Height when docked horizontally


property MaxVertDockSize : Integer

Max Width when docked vertically


property MaxWidth : Integer


property MinHeight : Integer


property MinHorzDockSize : Integer

Min Height when docked horizontally


property MinVertDockSize : Integer

Min Width when docked vertically


property MinWidth : Integer

AppBar MinMax dimensions when floating


property RootKey : Integer

RootKey in the registry where settings should be loaded/saved


property SlideEffect : Boolean

Slide Effect On/Off


property SlideTime : Integer

Slide Time


property TaskEntry : TAppBarTaskEntry

AppBar behavior in the Window Taskbar


property VertDockSize : Integer

Vertical size when docked on top or bottom


property VertSizeInc : Integer

Vertical size increment


Events


Variables


FabEdgeProposedPrev : TAppBarEdge;

We need a member variable which tracks the proposed edge of the AppBar while the user is moving it, deciding where to position it. While not moving, this member must contain ABE_UNKNOWN so that GetEdge returns the current edge contained in FABS.abEdge. While moving the AppBar, FabEdgeProposedPrev contains the proposed edge based on the position of the AppBar. The proposed edge becomes the new edge when the user stops moving the AppBar.


FABS : TAppBarSettings;

Internal implementation state variables } // This AppBar's settings info


FabSettingsLocation : TAppBarSettingsLocation;

We need a member variable to store the settings location in the registry


FbAutoHideIsVisible : Boolean;

We need a member variable which tracks whether our autohide window is visible or not


FbFullScreenAppOpen : Boolean;

We need a member variable which tracks whether a full screen application window is open


FTimer : TTimer;

We need a timer to to determine when the AppBar should be re-hidden