What's different with closing a window using Windows 7's taskbar preview? - windows-7

We have a windows app, written several years ago and maintained over time. We do not have any specific code to handle any Windows 7 UI features. Just plain old Winforms and WPF. We are seeing issues with closing windows using the Taskbar's preview and close button.
On some workstations, when the window is re-opened (calling the same tool via a menu), it is empty (white/blank). On other workstations, the same window is drawn outside the screen.
While there might be some custom code to initialize the window and restore it in the right location, what is troubling us is that none of those issues exist if we close the window using the standard close button on the title bar or using a "close" command.
Does anybody have any idea what is different between the closing of a window using the Taskbar and the standard button?
Regards,
Eric.

Related

Windows taskbar icon event type - WxPython Phoenix

I am trying to find the event type associated with windows taskbar icon of my application. In Windows 8.1 user can close, minimize and restore the application from this icon.
Google is only showing the results for taskbar tray icons, which is a whole different thing. So far I've tried these:
wx.EVT_CLOSE # This event is not generated for taskbar closing
wx.EVT_RESTORE # This event is not generated either
Yet, it does close the application and it also manages to restore an iconized application. I made two separate handlers to check this. They are working when I use the titlebar buttons (close and min/maximize buttons), but not when done from the taskbar.

Windows Phone (7+8) how to get a Popup Flyout style?

I've seen a Windows Phone 7 app with a window/popup which shows, after a use choice, half covering the current window, sliding in from the left while it closes when the users taps outside that window. For Windows 8x Store apps, this is a PopUp Control in a Flyout. But this is not available for Windows Phone.The regular pop-up control doesn't slide in with
<toolkit:TransitionService.NavigationInTransition>
which does work in a page-to-page transition. I have not succeeded either in closing it when I tap outside the pop-up. I tried adding LostFocus="MyEndPopUp" but that method is never called and also tried to end it on a OnNavigateFrom. What do I miss here?
If anyone could e.g. point me to some sample code doing more or less what I want would be great.

How can I disable / permanently hide the taskbar in Windows 7?

I would like to completely remove the Windows 7 taskbar, including tray and start-button, so that the user can not reactivate it by pressing the Windows-key on the keyboard. however, all other explorer functionality (i.e. starting an explorer Window using Windows+E) should remain.
Is it possible to permanently hide the complete taskbar? Maybe there are some registry values on could change in order to make that behaviour selectable using a powershell script?
Thanks a lot
Here be my solution (it hides rather than replaces or removes the native taskbar - this allows it to work with programs that have a dependency on the native taskbar, such as display fusions taskbar).
disable-taskbar-always-top
Still to solve: [HALF SOLVED]
Eliminate the stupid line that auto-hide leaves with some maximized applications, such as Google Chrome
HALF SOLUTION -
If you move the taskbar to the left or right edge prior to doing the above steps, you don't get the stupid auto-hide line at the top or bottom of Google Chrome. Since the native taskbar is not mouse sensitive anymore, it won't impact your use of hot corners, or multi monitors (for instance I have the native taskbar on the left of my middle monitor, and it does not popup when moving between monitors using the steps in this post).
Okay, I think I have finally - finally - got a workaround that:
Keeps the native Windows 7/8 taskbar hidden for your session (you do have a couple of steps you need to do on start-up each time, or if you manually un-hide the taskbar).
Prevents the native Windows 7/8 taskbar from opening with popups or programs seeking attention (flashing taskbar thing).
Prevents the native taskbar from being mouse sensitive (i.e. despite auto-hide, it will not appear when you mouse over the hidden taskbar anymore).
Allows you to use the screen area that is occupied by the native taskbar (this is the problem of not combining Taskbar-Hide with the autohide setting; you can't use that screen real-estate).
Allows you to run alternative taskbars that are dependent on keeping the native taskbar functional (for instance Dislay Fusions Multi-Monitor Taskbar + [Settings >> Advanced Settings ?> 'Show On All Montiors'])
One Time Steps:
1) Download and run this registry edit to prevent balloon notification popups from the native taskbar/system tray:
Notifications - Enable or Disable Message Balloons - Windows 7 Help Forums
(You can open this in notepad to see what changes it will make prior to installing it, if you want).
2) Download and run Taskbar-Hide from here:
Hide Taskbar: Hide Taskbar in Windows 8 | 7 with a hotkey
3) Set the taskbar to auto-hide
Optional:
3) B) Add a shortcut to Taskbar-Hide.exe in your startup folder, to have it launch automatically with windows on startup (you still need to use the Ctrl+Esc hotkeys to activate the functions of taskbar-hide - though you could also script this if you were really keen).
Startup Folder:
C:\Users{User Name}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Steps to hide taskbar after each start-up or manually un-hiding using Taskbar-Hide
4) Make sure Taskbar-Hide is running.
5) Make sure the taskbar is in its auto-hide state (i.e. you'll have to look at any programs that are currently seeking attention).
6) Once the taskbar is 'auto-hidden', press the hotkeys for Taskbar-Hide (Ctrl+Esc)
[This should mean that the native taskbar area is no longer sensitive to mouse activity]
One way is to replace the explorer shell with your own shell. This is the a common method done in Windows 7 Embedded.
In older versions of Windows (such as XP) it was possible to specifiy a shell for each user via regedit. I am not sure this is easily possible in Windows 7.
See https://superuser.com/questions/352865/how-do-i-change-the-windows-shell-for-only-one-user
Make an empty exe file and use it as the file to use in your "Custom User Interface" group policy. Additional information here.
I have found another solution that works nearly perfect for me, by just hiding the Taskbar and the Start button by simply sending both the WM_HIDE message:
Handle = FindWindow("Shell_TrayWnd", "");
...
ShowWindow(Handle, SW_SHOW);
The only problem I have with that solution is that the taskbar is not hidden permanently, i.e. as soon as one element is activated that does not have the focus, which on the taskbar leads to the item flashing in yellow, the taskbar gets visible again.
I'm not sure if there is a way to prevent Windows from re-enabling the visible flag of the taskbar in some way, or a method to hook to the SW_SHOW in C# though.

Which Windows process is displaying a given taskbar system tray icon?

How do I find which Windows process is displaying a given taskbar system tray icon?
I've just realised that in Windows 7 the 'Select which icons and notifications appear on the taskbar' menu helps a bit here. Find it by right-clicking the taskbar, go to 'Properties', then click the 'Customize...' button in the 'Notification area' frame.
Each row in that window represents a taskbar icon that Windows Explorer has seen. Of the left two rwos, I believe the top one is the process's description as shown in Task Manager, and the bottom one is the window title for the window showing the taskbar icon.
This would've helped me track down my original problem! VisualSVN was popping up a 'Register me!' nag window in the system tray, despite no obvious VisualSVN processes running. Eventually I noticed that this nag window disappeared when I closed Visual Studio, so it was clear that the VisualSVN add-in DLL loaded in Visual Studio was creating the nag window.
Shell_NotifyIcon works by sending a special WM_COPYDATA message to the taskbar, if you inject into explorer and subclass the taskbar you could catch this message, you could then get the process id by calling GetWindowThreadProcessId on COPYDATAstruct.NOTIFYICONDATA.hwnd.
...and of course, this is a hack and relies on undocumented information that could change at any time!
I don't believe this to be possible. Certainly Spy++ reports that the Notification area is a single window named "User Promoted Notification Area". This window is ultimately parented with the desktop window and has no obvious association with the process that created the notification icon.
Well, by possible I mean possible without resorting to hacks like Anders suggests which is no doubt feasible, but not what I imagine the OP is looking for!

Customizing dockable windows in Visual Studio

When developing on a system with dual monitors, I like to make the most of the extra space by stretching Visual Studio across both. It is fantastic to be able to see the Output, Breakpoints, Error List, Object Browser, and ReSharper windows at the same time without having to make them tiny and dock them in the main window, which leaves less space for code.
I place the main VS window on one monitor with the tabbed document and Solution Explorer windows. Any other windows I want to display are placed on the second monitor and docked together. The only problem I encounter with this method is that the main tabbed document window with the VS menu bar is the only window that can be maximized. The additional windows such as Solution Explorer, Breakpoints and Error List can only be stretched, docked or closed. I often go through the tedious work of selecting and laying out secondary windows only to have that layout be erased when I close VS.
Does anyone know of a VS add-in that gives you a window that (1) is maximizable, and (2) other windows can be docked in (ReSharper only does 2) ? Barring that, does anyone know of a good resource to learn how to develop VS add-ins? I am keen to do so myself if necessary.
I don't know of either of your suggestions, although I would also love to see better multiple-monitor support in VS. What I have done, though, is saved various window layouts (Tools > Import and Export Settings, and check only Window Layout) so that I can switch easily when I feel like it.

Resources