How can I make the taskbar icon for my app move to the same display as the app? - windows

Starting with Windows 8, there is a taskbar settings called Show taskbar buttons on where the user can control where the taskbar buttons are displayed when multiple displays are being used. How can I get my application to obey the Taskbar where window is open setting instead of always displaying on only the main taskbar?
The app in question is written in VB6 but I imagine this question might apply to other older frameworks as well.

Related

Win32/C++: Program started minimized shows generic icon in taskbar flyout preview - how do I set my own image or fix it?

When you hover the mouse over taskbar buttons in Win10 you get a preview of that Window in a flyout. However if I start my program minimized it shows a generic icon (if I then restore it, the preview is updated and works minimized or not - so on startup is the key).
How do I have it show what the window will look like when restored or set my own image to use so this doesn't happen? It's okay if my own image is the only one that ever shows. I wouldn't mind disabling the preview on the flyout either (I do need the flyout because I use use toobar buttons on it).
I see ITaskbarList3::SetThumbnailClip() but that would have the same issue.
TIA!!
Found this is controlled by the DWM (Desktop Window Manager) via dwmapi. Examples of use is here

Why are all my Delphi apps missing the taskbar menu on Windows 10 but not Windows 7?

In Windows 7 when I right click on the taskbar icon, all my Delphi apps (5, 2006 and XE) show the full taskbar menu: App name, Pin/Unpin and Close Window. On Windows 10 all these apps show only the Close Window menu item. Why is that and how can I get the full menu in Win10?
Update: If I create a new app in Delphi XE on Win 10 it shows the full menu. If I create a new app on Delphi XE in Win 7 it shows the full menu on Win 7 but not on Win 10.
No, this neither happens to all your apps (it happens to every application with a window), nor can David Heffernan be able to see it: Win10 just don't has that (most likely it was gone with Win8 already).
To make sure what fullerm is talking about: right-click on the task button and see its context menu: for every window you only have "close" plus two more generic entries, and then based on the application even more. But the system menu (right click on a window's top left icon) is not available thru the task button anymore
Task button = taskbar representing each currently displayed window. Pinned apps and shortcuts are not task buttons, neither are those of the task tray (rightmost next to the clock)
System menu = context menu every window owns with basic entries like "minimize", "maximize", "close", "size", "move" and even more. Accessible thru right clicking the topleft icon of a window or pressing ALT+SPACE. Might be inaccessible when the window is owner-drawn.
Window = owned by a running process. Processes neither need to have a window, nor are they restricted to only having one window. Nowadays Windows calls processes "apps" (I guess).

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.

Why does the taskbar appear when modeless dialog displayed on top of 3rd party fullscreen app?

I've uploaded a VS2010 project at the below location. This test app should be run once you have a full screen application running. As soon as its running, you have 2 seconds to click back on your fullscreen application. It creates 2 modeless dialog boxes using the full screen application (which should be the last window to have focus) as the owner of the dialog boxes. One dialog is displayed, hidden, the second dialog is displayed, hidden and then the first dialog is displayed again in a cycle. What I find is that when the first dialog box is displayed for the second time, the taskbar pops up. I've spent 4 painful days trying to understand whats going on here and I am desperate for some help.
I received some help which suggested that when I call DestroyWindow to hide the dialogs, Windows would put focus "somewhere" - and in my case the taskbar. Previously when I asked this question I wasn't using the full screen application as the Owner of my windows. I would have thought that the focus should go back to the owner window? I have also tried calling SetFocus() and SetForegroundWindow() on the full screen application prior to calling DestroyWindow on my dialog - but the seems to cause the taskbar to appear everytime and I don't want that at all.
Please help!
Sample VS2010 Project

Generic icon displays for my app in the Alt-Tab dialog

I have an old VB6 app and whenever the user does the Alt-Tab thing, the dialog displays a generic icon instead of the application icon.
What can I do to display the proper icon in the Alt-Tab window?
Each form has an "Icon" property you can set in the properties window to assign an icon. It sounds like this was used to set the icon on the main form, so your app's window looks correct.
However, there is also a project-level icon that is used for the Alt-Tab window and the taskbar. You set this on the "Make" tab of the "Project/Properties" dialog:
In the "Application" section, you can set the application's title, and use the dropdown list to assign one of the application's form icons to be the application icon. This is what will display in the Alt-Tab dialog and the taskbar.
Note that each form also has a "ShowInTaskbar" property that defaults to True. You should set this property to False for any non-modal forms in your app (other than the main form) to prevent them from displaying additional taskbar icons.
Finally, you should check the link on Adam Dempsey's answer to see how to support multiple icon resolutions. At the bare minimum, you can just create a 16x16 icon and attach it as described. Windows will handle the scaling, although you'll get some blurring when your icon is scaled up for higher resolutions.
It needs a bit of additional work than just adding the icon to a form, but easy enough to do:
http://www.vbaccelerator.com/home/vb/tips/setting_the_app_icon_correctly/article.asp
though this years old - I had the problem and solved it, and the solution isn't shown here. Since this in one of the top Google responses, i thought i'd add it here.
If you have set the icon on the form and in the settings, and it still isn't showing - you may have set the "ShowIcon" form setting to false. When this is false, even if you have an icon attached - it won't show in the Alt-Tab menu.

Resources