floatwnd.pas

来自「SourceTo概述 SourceTo是一个源代码转换工具。它对于需要将源代码转」· PAS 代码 · 共 39 行

PAS
39
字号
unit FloatWnd;

interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TTBFloatingWindowParent = class(TForm)
  private
    procedure WMActivate(var Message: TWMActivate); message WM_ACTIVATE;
  public
    constructor Create(AOwner: TComponent); override;
  end;


implementation

{ TTBFloatingWindowParent }

constructor TTBFloatingWindowParent.Create(AOwner: TComponent);
begin
  inherited;
  FormStyle := fsStayOnTop;
end;

procedure TTBFloatingWindowParent.WMActivate(var Message: TWMActivate);
begin
  SendMessage(Application.MainForm.Handle, WM_NCACTIVATE,
    Ord(Message.Active <> WA_INACTIVE), 0);
  {if Message.Active <> WA_INACTIVE then
  begin
    if not IsWindowVisible(Handle) then
      SetActiveWindow(FindTopLevelWindow(Handle));
  end;}
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?