Hide the icon from a WPF window

前端 未结 3 1384
难免孤独
难免孤独 2020-12-16 04:10

I know that there are many questions about hiding or removing the icon from the upper left corner of a WPF window, the place where the system menu is. I\'ve tried many of th

3条回答
  •  醉酒成梦
    2020-12-16 04:49

    The above does not work, when creating a dialog window from a WPF application having an icon. However, when adding the following two lines, the icon correctly vanishes from the dialog window:

    SendMessage(hwnd, WM_SETICON, new IntPtr(1), IntPtr.Zero);
    SendMessage(hwnd, WM_SETICON, IntPtr.Zero, IntPtr.Zero);
    

    (s.a. https://connect.microsoft.com/VisualStudio/feedback/details/745230/wpf-window-cannot-be-displayed-without-titlebar-icon)

提交回复
热议问题