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

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.

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

How to enable auto generation of Window MenuItems (e.g. Tile Window to Left/Right of Screen and Open file with checkmark) in macOS menubar

I am currently creating a macOS menubar for an app without using any interface builder (no XIB/NIB files), just pure code. However I was expecting some items to be auto-generated during the start-up of the app. Items like "Start Dictation", "Emoji & Symbols" under Edit menu were existing as well as the "Enter Full Screen" menu item under the View Menu. But when it comes to Window Menu nothing was automatically generated, only the menu items I've set in the code. Do I have to enable some flags or options when instantiating a Window NSMenu so it automatically generates those items? I am new to macOS development so I feel like I am kind of lost. Thanks in advance.
The Window and Help menus are a little special in that they have their own NSApplication properties, so you will need to set them to your menus so that the system will know what they are.
For example, if you just create a window menu and add it to the main, all you will get are the items that you have provided. If you also set it as the application’s windowsMenu, in addition you will get all the stuff for moving, tab support, etc.
Setting NSApp’s helpMenu is similar, where a Spotlight menu item is added to the menu.

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

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.

xul dialog box wont have maximize and minimize buttons after updating firefox to version 32.0

used dialog tag in xul for a dialog box for an xul application.Earlier before firefox update the tool had maximize and minimize buttons but after update the buttons are no longer there in the tool.
MDN Docs: Window.openDialog, Window.open, <window>, <dialog>, <dialogheader>, Dialogs and Prompts
Without all of: The Firefox version from which you were upgrading, the version you upgraded to, the code you are using to open the window, and the XUL used to describe the window it is difficult to provide you with an answer which actually covers what you want to know.
MDN has the following to say on dialog windows: "Dialog windows are windows which have no minimize system command icon and no maximize/restore down system command icon on the titlebar nor in correspondent menu item in the command system menu. They are said to be dialog because their normal, usual purpose is to only notify info and to be dismissed, closed. On Mac systems, dialog windows have a different window border and they may get turned into a sheet."
That makes is clear that dialog windows do not normally have the controls you are asking about.
However, you can pass minimizable in the features parameter of the window.open() or window.openDialog() functions to turn on minimize control.
In general, if you want a dialog to have minimize and maximize buttons, you have to open it as a normal window with window.open(). You can limit the other toolbars that it has at the top by supplying appropriate parameters in the window.open() call. You can also make it modal, like some dialogs. You then create your own OK and Cancel buttons with appropriate code to accept the information in the dialog or cancel. Basically, if you want a maximized window for a dialog it should usually be doing quite a bit. In such case, you probably want more control over how your window looks than is available from a dialog window. Dialogs are, generally, subset of what windows can do with the ability to have a few buttons easily provided.

Borderless Taskbar items: Using a right click menu (VB6)

Even when BorderStyle is set to 0, it is possible to force a window to show up on the taskbar either by turning on the ShowInTaskbar property or by using the windows api directly: SetWindowLong Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, Win.GWL_EXSTYLE) Or Win.WS_EX_APPWINDOW. However, such taskbar entries lack a right-click menu in their taskbar entry. Right-clicking them does nothing instead of bringing up a context menu. Is there a way, to attach a standard or custom handler to it?
Without a hack, I think you're going to be stuck here, I'm sorry to say. When you set the VB6 borderless properties, you inherently disable the control menu. The control menu (typically activated by right-clicking the title bar of a window or left-clicking the icon in the upper left) is what's displayed when you right-click a window in the task bar.
Now, if you're in the mood to hack, you might be able to "simulate" the behavior in such a way that the user doesn't know the difference. I got the idea from this message thread on usenet.
Basically, it sounds like you may be able to hack it by using two forms. One form is minimized right away, and becomes your "stub" in the task bar. The other form is the one you're currently designing (which we'll call the "main" form). The stub form is what actually loads and displays your main form.
The stub form isn't borderless, and must not deactivate the control menu. It is positioned off screen and at the smallest possible size. You'll respond to its form-level events, and then use those to communicate the appropriate behaviors to the borderless form.
That's the general gist of the hack. If I wasn't at work right now, I'd whip up a simple VB6 project and see if I could get it to work for you.

Resources