Hide a form's taskbar button without using WS_EX_TOOLWIN

前端 未结 7 2193
太阳男子
太阳男子 2020-12-16 06:59

I need to hide a Windows form from the taskbar but I can\'t use WS_EX_TOOLWINDOW because I need the system menu and min/max buttons on the form\'s title bar.

相关标签:
7条回答
  • 2020-12-16 07:36

    Thanks to Stu for putting me on to the answer so quickly. In my case I had to manually add the owning form's handle into the CreateParams, but that may not be necessary in other/normal cases.

    procedure TfrmWord2Site.CreateParams(var Params:TCreateParams);
    begin
      inherited CreateParams(Params);
      Params.WndParent := <your owner form>.Handle;
      Params.ExStyle := Params.ExStyle and not WS_EX_APPWINDOW;
    end;
    
    0 讨论(0)
提交回复
热议问题