In Google's Chrome App Launcher for Windows, does anyone know how they managed to show the window such that it's centered above the application's icon in the TaskBar? Any kind of solution for C#/.NET would be fine (p/invoke, etc.).
I've searched high and low and there are solutions for the System Tray based on identifying the screen rect of a notify icon, but I have not found one for the TaskBar (except one approach that is based on a screen capture, but it's too fragile for production applications).
Thanks!
-Tom B.
Thanks to NETscape's hint, I found that the way that the Chrome App Launcher makes it look like the window is appearing over the TaskBar icon is by checking the mouse position immediately after starting up, and if the mouse is in the TaskBar area then it shows the window directly above the TaskBar and horizontally centered over the mouse.
You can test this by moving the mouse left or right immediately after clicking the icon, in which cases the window appears to the left or right of the TaskBar icon. If you move the mouse outside the TaskBar area right after clicking it (or launch the app from a Desktop icon) then the window is just anchored to the lower-left corner of the screen.
Related
I'm finding that if you use the NotificationWindow with Silverlight 5 runtime in an out of browser app, while the notificationwindow is visible it captures any mouse input in the top left corner of the application's main window.
This can be easily demonstrated for example the sample here : http://forums.silverlight.net/t/212852.aspx/1
You simply add a button so it sits at the top left of the screen. It is not possible to click the button while the NotificationWindow is visible. This does NOT happen on SL4 runtime, but does happen on each of the SL5 machines I have tested.
The area that gets captured corresponds to the size of the NotificationWindow, as if the notification window was located at the top left of the MainWindow. If your NotificationWindow content has any controls, you can even click those controls by clicking in the corresponding location on the main window!
I've hit this problem on a SL4 application where users with Silverlight 5 runtime can no longer use the buttons on the top left of the main window.
Any help would be much appreciated.
Thanks
Danny
I'm not sure if what I want to do is appropriate, so I'll explain a little.
We've got a large application that takes a while to load. So we have a splash screen.
The Splash screen causes excessive load time on Remote Desktop (terminal server).
So to alleviate this, we want to hide the splash screen when loading on RDP.
But we still need to at least show the user that the application is loading.
So, I was thinking perhaps just show something in the Taskbar (not the system tray), as it will disappear once the application is fully loaded (and be replaced by the main form's Task icon).
However any WPF solution I've looked at, requires a visible form/window to go with the Taskbar status.
Is there any way of showing something in the Taskbar without showing a WPF window?
Or is there another way of showing application load status without something on the screen?
We had same problem.
On remote desktop, we did following steps...
We configured the Splash window to not allow resizing and have only Minimize and Close button.
We removed WindowStyle=None setting so that title bar of the Splash window appeared
We made the Splash window's width and height zero. This way all you see on screen is a small blue rectangle of the title bar with Text "Loading... Please Wait ..." and minimize and Close button.
We used Window's kernel calls to disable title bar's Close button too. This way user was not able to cancel the Splash window.
So all a user could do is to minimize or restore from taskbar.
When restored, all he sees is a title bar's blue rectangle with "Loading..." text. This way the window also claimed its place on the task bar but hid its splash animation and user is also aware that the splash screen is loading. For this you can also update the Title bar's text by appending more fullstops ...
Loading. Please Wait..
Loading. Please Wait...
Loading. Please Wait....
Loading. Please Wait..
I do think you need to look into the root cause of your issue. Possibly looking at threading and parallelism.
However, a simple solution to what you are asking would be to just create a hidden window. One that is transparent, no borders or anything. It could even bet set to a size of 0, 0. That way you would be able to get the taskbar item that you require.
I have add a ScrollViewer in my WPF4 Window with ScrollViewer.PanningMode.
When I drag scrollviewer on my multitouch screen it's OK. But... the Window move with scroll when I arrive on top scroll or bottom scroll.
How can we avoid this?
Edit: To complete the answer: There is a native event for this which can just be marked as handled: ManipulationBoundaryFeedback
This movement is called boundary feedback which is governed by the operating system (can be set by users in the Pen and Touch settings on the Panning tab). I do not know if the Windows API allows you to prevent it, this page might be relevant.
My application is designed to sit in the system tray and behave similarly to the Network/Volume/Power/Action Centre tray items in Windows 7 (and the equivalent items in Windows Vista). That is, it becomes visible when the tray icon is clicked, and becomes hidden when focus is lost.
The application is written in WPF, but I am currently using NotifyIcon from WinForms for the tray icon.
I would like to know if anyone has any suggestions as to how I might determine the position (i.e. screen coordinates) of my application's tray icon. The default Windows Vista/7 tray items have some way of doing this, since the pop-out windows are centre-aligned above the relevant tray icon.
In Vista this wasn't much of an issue: I had the application permanently set to the bottom-right corner, and this looked fine (though there was no logic included for cases when the taskbar wasn't placed at the bottom of the screen). However, in Windows 7 my application ends up obscuring the new system tray pop-out box, rather than hovering above it like the volume controls, etc., do.
The best solution I've seen in my searches so far is to handle the mouse-up event on the NotifyIcon and use the mouse coordinates to determine the position of the icon. I think I'll end up using this method if unless someone has a better idea, though it's not ideal as the position will vary slightly depending on where within the icon the user clicks.
Windows 7 and higher expose the Shell_NotifyIconGetRect() function, which returns the screen coordinates of the icon's bounding rectangle.
You'll need to provide it the notify icon GUID, though, and I don't know if you can access that property through the managed NotifyIcon class.
Further to this, I've written about a method to find the location of a notify icon when the Shell_NotifyIconGetRect function is not available: http://blog.quppa.net/2010/12/28/windows-7-style-notification-area-applications-in-wpf-part-6-notify-icon-position-pre-windows-7/
I created a WPF window with system tray icon via NotifyIcon. When I click the icon in the system tray, the WPF application pops up and is shown on the screen.
But this solution does not fit my needs. I want the solution to be opened the same way the volumn, network center, security center, etc. is opened on system tray icon single click (just a little tiny box on top of the taskbar which can neither be moved nor has a close button in the upper right corner).
Can anyone give me a hint?
Does WindowStyle.None fit your needs (Can be set in the WindowStyle Property of your Window)?