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;
沒有留言:
張貼留言