How to hide a taskbar entry but keep the window form?

為{幸葍}努か 提交于 2019-12-12 11:23:36

问题


I'd like to hide the taskbar entry to maximize effective space since the app has a systray icon, i dont need the taskbar entry. The app doesnt allow you to only have a systray instead of both.

How can I hide a taskbar entry but keep the window form?


回答1:


In what language is your application written?

The API call you want is called SetWindowLong.

Example Delphi code would be:

procedure TForm1.FormCreate(Sender: TObject);
begin
  ShowWindow(Application.Handle, SW_HIDE);

  SetWindowLong(Application.Handle, GWL_EXSTYLE,
          GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW);

  ShowWindow(Application.Handle, SW_SHOW);
end;



回答2:


Following is for MSVC:

if (bShow)
    ModifyStyleEx(0, WS_EX_APPWINDOW);
else
    ModifyStyleEx(WS_EX_APPWINDOW, 0);

ModifyStyleEx documentation is here.

Links:

  • How To Hide A Window in TaskBar.
  • How to dynamically show/hide the Taskbar application button.



回答3:


.NET

Solution for C# would be:

ShowInTaskbar = false;

Solution for VB.NET would be:

ShowInTaskbar = False


来源:https://stackoverflow.com/questions/1553923/how-to-hide-a-taskbar-entry-but-keep-the-window-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!