【Delphi】偵測是否啟動 Windows 的 "自動隱藏工具列"

uses 區段加入 ShellAPI,如下:
uses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,  StdCtrls, ShellAPI;

implementation 加入程式碼,如下:
implementation

{$R *.dfm}

function IsTaskbarAutoHideOn : boolean;var   ABData : TAppBarData;
begin
    ABData.cbSize := sizeof(ABData);
    Result := (SHAppBarMessage(ABM_GETSTATE, ABData) and ABS_AUTOHIDE) > 0;
end;


Form1 放一個 button,並在 OnClick event 寫入:
procedure TForm1.Button1Click(Sender: TObject);
begin
    if IsTaskbarAutoHideOn then
        ShowMessage('自動隱藏工具列');
end;