WpfAppBar
WpfAppBar copied to clipboard
Check if the system approves ABMsg.ABM_NEW
In AppBarFunctions.cs:137 you are assigning the return value of ABM_NEW
to ret
but not using it anywhere in the code:
var ret = Interop.SHAppBarMessage((int)Interop.ABMsg.ABM_NEW, ref abd);
Consider using ret
info.IsRegistered
to determine whether the registration succeeded and if not, omit ABSetPos()
(Which then would overlay other windows / bars)
The return value of SHAppBarMessage(ABM_NEW, ref pData)
is described in MSDN - ABM_NEW message:
Return value Returns TRUE if successful, or FALSE if an error occurs or if the appbar is already registered.
Is there a test case that would show what the issue is so that when fixed, it can be verified as fixed?
Windows server core-Installation and XP Embedded return false. Also a Rectangle
which isn't in the workingArea returns false, but not in all cases.
I would suggest to combine this as an enhancement with multi screen support because with multiple screens, the WorkingArea isn't a Rectangle in every case (two displays with different resolution) and it happens more often that the system doesn't approve a SHAppBarMessage