欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Delphi 任务栏中不显示窗口

程序员文章站 2022-06-15 14:25:25
示例: type TAppWndBrowser = class( TForm ) published procedure CreateParams( var Params: TCreateParams ); override; procedure WndProc(var Message: TMess ......

示例:

type
  tappwndbrowser = class( tform )
    published
      procedure createparams( var params: tcreateparams ); override;
      procedure wndproc(var message: tmessage); override;
  end;

implementation

{$r *.dfm}


{ tappwndbrowser }
procedure tappwndbrowser.createparams( var params: tcreateparams );
begin
  inherited createparams( params );
  params.style:=ws_child;
end;

procedure tappwndbrowser.wndproc(var message: tmessage);
begin
  inherited wndproc(message);
  if (not application.mainformontaskbar) and (message.msg = wm_showwindow) then
  begin
    showwindow(application.handle, sw_hide);
    setwindowlong(application.handle, gwl_exstyle, ws_ex_toolwindow);
  end;
end;