Giter VIP home page Giter VIP logo

wpfappbar's People

Contributors

benji-yarmand avatar danielchalmers avatar gabriellaheil26 avatar masbicudo avatar philiprieck avatar reptail avatar thedewi avatar tonyvalenti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wpfappbar's Issues

Missed opportunity

I would just like to point out that this library could have been named AdmiralAppBar.

Nice work, though.

Windows 8.1 multiple taskbar problem

Hi, i've encountered problem using this library on win 8.1, docked to top.
The first bar is docked correctly, and the desktop size is shrinked without problems.
Starting with second bar, stange things happens, including: desktop not shrinking, overlapping bars, smaller bars.
The problem is Always reproducible on win 8.1 64; just create an empty window with a "quit" button and launch the same executable from bin/debug multiple times.
I was working on a library before finding this (d'oh!) and mine has the same problem, even if seems there are some differences.
I've read multiple times msdn article describing desktop appbar development, and all seems ok.
( https://msdn.microsoft.com/en-us/library/windows/desktop/cc144177(v=vs.85).aspx )
Any ideas? have you tried it on 8 / 8.1?

Support for .NET Framework 4.8?

Problem Statement

I'm trying to use this for an app I created at work, but I can't seem to get it to run.

Summary:

  • It might be the tool I used to convert from C# to VB or something. I'm not quite sure as I'm still new to coding. I'm using Visual Studio 2022 and making a WPF .NET app with .NET Framework 4.8.

Setting background color doesn't work

Hello,

I tried setting the background property of the window or any other color related property but that doesn't seem to work. Do you have any idea how this can be achieved?

Best regards

Sascha

Question RE Pull Request

Hi @PhilipRieck ,
I've been using this library for over a year now and I've run into a few issues that we've corrected and I'm wondering if our pull request would be welcome.
Issues:
1 - When you make a window toggle back and forth between being an app bar, AddHook will be called called multiple times but the hook but the hook never gets removed.
2 - When sending the resize command, it uses BeginInvoke. This works fine when calling SetAppBar just once, but if you call it back-to-back you can get situations where things aren't executing in the order that you'd expect. We made SetAppBar async and awaited on Dispatcher.InvokeAsync and it worked fine.

Would a pull request containing the two fixes and changes above be welcome?

Support HighDPI

As you're probably aware, with Windows, highDPI is supported by implemented a screen scale (or text scale, for older versions of Windows). However, the calculation ends up being incorrect in such scenarios and the end result is that windows' partly end up behind the app bar.
Any suggestions on how screen scaling could be supported?

Problem on exiting while docked

When exiting the application in a docked state, the docked area will be blocked for other applications. Is there a way to properly exit the app in a docked state?

(tested on Windows 10)

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.

Taskbar issue

Thanks for doing this :)

When docking bottom with visible Taskbar, it shrinks the height of the application by the Taskbar height. Do this multiple times (Dock down<->up) the application will shrink to 0
Windows 8.1

Support for high DPI settings

The window is not scaled properly when using non-96 dpi settings. There is a call to transform the working area to pixels, but the result is not used in the code.

My solution was to do this:

double dpiWidthFactor = toPixel.M11;
double dpiHeightFactor = toPixel.M22;

var actualWorkArea = GetActualWorkArea(info);

if (barData.uEdge == (int)ABEdge.Left || barData.uEdge == (int)ABEdge.Right)
{
    barData.rc.top = (int)(actualWorkArea.Top * dpiHeightFactor);
    barData.rc.bottom = (int)(actualWorkArea.Bottom * dpiHeightFactor);
    etc.        

So anywhere the working area was used, it is multiplied by the dpi factor.

strange error

I was try your helper class with some very basic empty project:

private void Form1_Shown(object sender, EventArgs e){
AppBarFunctions.SetAppBar(this, ABEdge.Right);
}
and I've got that error:
Error CS1503 Argument 1: cannot convert from 'Solution1.Form1' to 'System.Windows.Window'

I really can not understand where is the problem :( Why i can not use 'this' as argument here?

Just to let you know...

Hi there,

Sorry to use the Issues system but was not able to find another way to message you.

I have created a similar library for WinForms. This is based on yours and some other resources found online.

I have added a link back to your repo for WPF, perhaps you would like to do the same for WinForms?
https://github.com/tip2tail/t2tWinFormAppBarLib

Finally, thank you for your initial work - great library! ๐Ÿ‘

Mark

Multi screen support

Great work on this :)
Not sure if it's an issue or simply a wish/question.

Is it possible to put the app bar on the secondary screen?
It keeps putting it on the primary screen, any way to prevent/alter the destination screen?

๐Ÿ‘

Auto Hide

I've forked your repo in an effort to add auto hide support. I just cant get it to work. Ive tried ABM_SETAUTOHIDEBAR and ANM_SETATOHIDEBAREX, I do this right after your call to ABM_NEW.

There's very little written about this on the web, so its requiring trial and error, perhaps its because Im on Windows 10...

If you have any ideas or are able to get this working with your code, Id love to know.

App bar crashing on higher resolution

app worked fine on standard resolution. But it crashed on micro soft surface with following error.

Exception:
Application: EPG-TickerApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
at System.Windows.Size..ctor(Double, Double)
at WpfAppBar.AppBarFunctions.ABSetPos(RegisterInfo, System.Windows.Window, System.Windows.FrameworkElement)
at WpfAppBar.AppBarFunctions.SetAppBar(System.Windows.Window, WpfAppBar.ABEdge, System.Windows.FrameworkElement, Boolean)
at EPG_TickerApp.MainWindow.MenuItem_Click_3(System.Object, System.Windows.RoutedEventArgs)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs)
at System.Windows.Controls.MenuItem.InvokeClickAfterRender(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at System.Windows.Application.Run()
at EPG_TickerApp.App.Main()

.net standard library

Since the release of dotnet core and .netstandard if you include this library then you get a compiler warning. If setting it up with .netstandard in the nuget package then this warning would disappear.

PR #24

Hi Philip,
Could you publish an update to WPFAppBar that includes the changes I just committed in #24

Can't load the solution, VS2017

"---------------------------
Microsoft Visual Studio

One or more projects in the solution were not loaded correctly.

Please see the Output Window for details.

OK

"

docking right in Windows10 not working

in Windows10 when docking on the right side, the space is reserved, but the window is not "docked" inside that space, but to the left of it, thus consuming double the width it should be.

Ignore Taskbar

I want to make my own task bar but it seems like its adding the height of the default task bar.
Is there anyway to fix this? Thanks.

image

Issue when Task Bar is not at Bottom or when any other App Bar is also present.

Hey Phillip,
I found this Issue with the code which leads into rendering Issues of the App in cases when the effective Workspace starting coordinates are not (0,0). I have already fixed it for me, but can't commit the code right now due to some system restrictions. The fix is as below:

under WpfAppBar.AppBarFunctions.ABSetPos, initialize barData.rc Values with SystemParameters.WorkArea values instead of set constants.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.