Is there a way to create a Windows 10 app that reside in taskbar similar to People App?
Asked Answered
N

2

6

I would like to create a solution that will be like an icon on the taskbar and once clicked it will open as a small popup above the taskbar which will not interrupt the user or other windows similar to the Microsoft People app that will show on the bottom right as the following image: enter image description here

This question has a similar title to my question but it's different subject where the asker was asking for the AppBar of the UWP app which is not my intention. Other question

Is there a way to do that for normal developers, enterprise companies, or Microsoft partners?

Nuptials answered 8/12, 2019 at 10:47 Comment(14)
Notifications and the Notification Area.Supersonics
@IInspectable, thank you for your comment but i already have a System Tray component in my solution and the best it can do is to show a windows 1998 menu with SubMenus at bestNuptials
Does this answer your question? Placing toolbar into Windows taskbar (ala language bar)Mercurialize
@RaymondChen, i am not able to find the example in the answer. The other answers have outdated winforms solutions that doesn't provide rich features or decent UI for our time. Thanks for your commentNuptials
XAML Islands solves that issue. Besides, there is nothing "outdated" about Windows Forms, or the native Win32 windowing API.Supersonics
But still it will be an old style window with semi updated components. It will not be as close of UX as the app in the screenshotNuptials
The thing to search for is "deskband" (and the interface name IDeskBand). You can find it on MSDN as well as elsewhere on this site.Mercurialize
@RaymondChen, this deskband will not satisfy my UX requirements even it worked in windows 10 which i highly doubt.Nuptials
The DeskBand gets you space on the taskbar. The rest (creating the button, showing a pop-up, etc.) is up to you.Mercurialize
@RaymondChen, from the documentation: Important,You should use thumbnail toolbars in new development in place of desk bands, which are not supported as of Windows 7. I even checked this thumbnail option and it does not satisfy my requirements. learn.microsoft.com/en-us/windows/win32/shell/… i am happy to take in this in the chat and thanks for the supportNuptials
Sorry, didn't realize that deskbands are no longer supported in Windows 10. You can try using a notification icon as a substitute. You can show a full window when the user clicks on the notification icon; you aren't limited to a menu. For example, the OneDrive app shows a big fancy popup window.Mercurialize
@RaymondChen, OneDrive, Skype, and People (the app in the screenshot) are developed by Microsoft. They might have access to an API that normal developers don't. I already have a winforms NotifyIcon so i will try to implement something and see how it will look. Thanks againNuptials
DropBox does it too. Skype is not part of Windows and is subject to the same constraints as third party apps.Mercurialize
Any update on this? No one invested that deeply in Window applications?Nuptials
E
6

Update 3rd :

enter image description here

Recently I tried to build the App, shared in this repo https://github.com/ejabu/TrayApp

things to note :

  1. WindowStyle

to get Borderless window like People App.

<!-- MainWindow.xaml -->
<Window
        ....
        WindowStyle="None">
    <Grid/>
</Window>

  1. ShowInTaskbar

ShowInTaskbar -> False

to prevent it appears on Taskbar

<!-- MainWindow.xaml -->
<Window
        ....
        ShowInTaskbar="False" 
        ...>
    <Grid/>
</Window>

  1. Use Hide Method
/// MainWindow.xaml.cs

  private void Hide_Window()
  {
      this.Hide(); /// Minimize Window
  }

  1. Adjust Position according to Taskbar
/// MainWindow.xaml.cs

  private void AdjustWindowPosition()
  {
      Screen sc = Screen.FromHandle(new WindowInteropHelper(this).Handle);
      if (sc.WorkingArea.Top > 0)
      {
          Rect desktopWorkingArea = SystemParameters.WorkArea;
          Left = desktopWorkingArea.Right - Width;
          Top = desktopWorkingArea.Top;
      }

      else if ((sc.Bounds.Height - sc.WorkingArea.Height) > 0)
      {
          Rect desktopWorkingArea = SystemParameters.WorkArea;
          Left = desktopWorkingArea.Right - Width;
          Top = desktopWorkingArea.Bottom - Height;
      }
      else
      {
          Rect desktopWorkingArea = SystemParameters.WorkArea;
          Left = desktopWorkingArea.Right - Width;
          Top = desktopWorkingArea.Bottom - Height;
      }
  }

Update 2nd :

https://github.com/AronDavis/TwitchBot/blob/master/TwitchBotApp/Notification.xaml

Update:

https://www.youtube.com/watch?v=jdvD55ir1is

original :

this is the good example

Final Result

enter image description here

the Window page has no Close button. And also it cannot be dragged by commenting this line https://github.com/ejabu/AcrylicWindow/blob/343f4f5a6bc23109a97640f9ac35facb31e9ae43/AcrylicWindow/MainWindow.xaml.cs#L30

I found example project here

https://github.com/shenchauhan/MyPeople/tree/master/MyPeople/MyPeople

We may look at MyPeopleCanvas then.

I found also there is new update from Microsoft, that maybe we can replace Icon images with text in System Tray icon in the near future.

https://newswwc.com/technology/dotnet-technologies/personalized-content-at-a-glance-introducing-news-and-interests-on-the-windows-10-taskbar/

Establishment answered 4/6, 2021 at 11:41 Comment(4)
learn.microsoft.com/en-us/windows/uwp/design/…Establishment
I've got here while looking for any way to implement something like the "News and Interests" thing next to the clock. Seems like it's not documented yet :(Bitolj
@ejabu, Those are excellent updates. Thanks for sharing the code too. I will check it out. Many thanks.Nuptials
sure @Ali123, please open any issue on the repo in case there are needs to discuss for further developmentEstablishment
N
0

This is the closest i got to what i needed. Although it's using ElectronJS and not WPF or UWP. But since it's doable with ElectronJS then it should also be doable on WPF.

https://github.com/sfatihk/electron-tray-window Library is not created by me.

Nuptials answered 26/5, 2020 at 17:48 Comment(1)
If you want to use electron, use this github.com/maxogden/menubarMorea

© 2022 - 2024 — McMap. All rights reserved.