windows-virtualdesktopindicator
windows-virtualdesktopindicator copied to clipboard
Crashes on Windows 11 Pro 22H2 22581.1 Windows Feature Experience Pack 1000.22581.1.0
Error message:

same to me on Windows 11 home 22H2 Windows Feature Experience Pack 1000.22581.100.0
The same on my machine: Windows 11 Pro 22H2 22581.200
On Windows 11 Pro 21H2 22000.652 Windows Feature Experience Pack 1000.22000.652.0 - It runs and works, but usually for not any longer then 15 minutes until it silently crashes and its no longer showing on the tray. The following error is logged in event viewer:

same on windows 11 insider preview 22621.1
This util works with Win11 22H2. https://github.com/dankrusi/WindowsVirtualDesktopHelper
Similar issue.
" try { if (CurrentVirtualDesktop == _lastVirtualDesktop) return; if (UserConfig.Current.NotificationsEnabled)"
Never makes it to the 2nd if.
Ex says: "A null reference pointer was passed to the stub. (0x800706F4)"
There is a bug in the code somewhere. It seems that as soon as the timer calls the function it creates an error(just so happens on my machine it occurs between the first and second if's which is just a simple integer comparison so it is unlikely to be that code and hence we can deduce that it happens somewhere else and likely in some initialization code that is faulty.
Disabling the timer callback gives an error here
var result = Shell_NotifyIconGetRect(ref notifyIcon, out rect);
if (result != WinError.S_OK)
{
throw new Win32Exception(result);
}
I can't easily debug the app because for some reason when debugging VS becomes extremely unresponsive.
"Error HRESULT E_FAIL has been returned from a call to a COM component." from var result = Shell_NotifyIconGetRect(ref notifyIcon, out rect);
So the error seems to be that the app cannot get the coordinates required to display info in the notification area. Not sure what this could be from except possibly some issue with com or windows taskbar. Seems to be related to how the app handles displaying the icon