Under Windows 7, IE 8 shows every open tab as a taskbar thumbnail. How can I achieve this in my own app?
MSN Messenger exhibits the same behavior.
I believe that this is done with the Windows API Code Pack: http://code.msdn.microsoft.com/WindowsAPICodePack
And here's a blog post explaining how "custom window previews can be used to expose a list of child windows (browser tabs) as thumbnail- and peek-enabled windows in the taskbar." Sounds like what you need: http://blogs.microsoft.co.il/blogs/sasha/archive/2009/02/12/windows-7-taskbar-apis.aspx
The following article should help. There are several new taskbar features in Windows 7, all of them are discussed at the link below.
http://msdn.microsoft.com/en-us/magazine/dd942846.aspx
Note that the Aero Peek feature has nothing to do with task bar buttons, it just lets you make all windows fully transparent to preview your desktop and gadgets. What you were actually looking for is "Windows 7 Grouped Taskbar Thumbnails", in case you need to do additional searches.
This is the best reference I've got. Note that I'm assuming native code here, a .NET equivalent could be p/invoke'd up in a fairly straight forward manner.
It boils down to the following:
For each tab, create a proxy window
For these windows call DwmSetWindowAttribute to set DWMWA_FORCE_ICONIC_REPRESENTATION & DWMWA_HAS_ICONIC_THUMBNAIL
Whenever these proxy windows receives a WM_DWMSENDICONICLIVEPREVIEWBITMAP message, render the corresponding thumbnail into the proxy window
Whenever a proxy window receives a WM_ACTIVATE, switch to the correct tab
You also need to handle WM_SYSCOMMAND
Grab your ITaskbarList4
Use it to register each of your proxy windows as a tab
Manage tab order and what not via the ITaskbarList4 interface (this includes activating tabs)
It seems like there should be a better way to do this, but its all I'm aware of at the moment.
Related
Is it possible to for an app to respond to Expose on MacOS such that it can choose what gets displayed?
I often use Expose to switch windows. The problem is if the windows look similar then it's harder to know at a glance which one I want.
Trying to switch to one of the 4 Visual Studio Code windows or one of the 4 terminal windows is not as easy as it could be if each window showed more info, for example the document name.
I can hover the mouse over each window but that's not "at a glance" so what I'd like to do is, if and only if Expose appears, choose what Expose shows for my app.
One solution I thought of is to change the display if my app's window does not have the focus. Unfortunately that's not a solution. Often I have windows side by side so I can see both windows. If I changed the display of the unfocused window that would make side by side unusable.
Does MacOS provide an API for responding to expose? Note: I'm asking a programming question. If I was to want to add this feature to Visual Studio Code or ITerm2 or my own app what is the MacOS level event I trigger on? I've never seen an app change its representation in expose so I'm guessing there is no way to do it.
I created a little Vision2 window with an animation in it.
In my Windows 7 environment, I want this animation to be always visible on top all other windows on my desktop. I'm able to periodically call raise to bring the Vision2-window in front - but I lose focus of my selected window doing that.
To boil it down:
Q1: Is it even possible to keep a window "always on top" all other windows with Vision2 ?
Q2: Is it possible to do it with Eiffel WEL (and Windows 7) ?
Talking about Windows in general, it is not possible to guarantee that a window will be on top of all other windows, because if you have 2 windows that have this property, one of them will be on top of the other. As you will see in the post below, you have 2 categories of windows and z-order:
http://blogs.msdn.com/b/oldnewthing/archive/2005/11/21/495246.aspx
Assuming you are ok with something on top of all your windows, in WEL, you can use the Win32 API to achieve that by using WEL_WINDOW.set_z_order ({WEL_HWND_CONSTANTS}.hwnd_topmost).
In Vision, you can also do that by using EV_POPUP_WINDOW and calling `disconnect_from_window_manager' on it.
I want to get the window handle of some controls to do some stuff with it (requiring a handle). The controls are in a different application.
Strangely enough; I found out that many controls don't have a windows handle, like the buttons in the toolbar (?) in Windows Explorer. Just try to get a handle to the Folder/Search/(etc) buttons. It just gives me 0.
So.. first question: how come that some controls have no windows handle? Aren't all controls windows, in their hearts? (Just talking about standard controls, like I would expect them in Windows Explorer, nothing customdrawn on a pane or the like.)
Which brings me to my second question: how to work with them (like using EnableWindow) if you cannot get their handle?
Many thanks for any inputs!
EDIT (ADDITIONAL INFORMATION):
Windows Explorer is just an example. I have the problem frequently - and in a different application (the one I am really interested in, a proprietary one). I have "physical" controls (since I can get an AutomationElement of those controls), but they have no windows handle. Also, I am trying to send a message (SendMessage) to get the button state, trying to find out whether it is pushed or not (it is a standard button that seems to exhibit that behaviour only through that message - at least as far as I have seen. Also, the pushed state can last a lot longer on that button than you would expect on a standard button, though the Windows Explorer buttons show a similar behaviour, acting like button-style checkboxes, though they are (push)buttons). SendMessage requires a window handle.
Does a ToolBar in some way change the behaviour of its child elements? Taking away their window handle or something similar? (Using parent handle/control id for identification??) But then how to use functions on those controls that require a windows handle?
If they don't have a handle, they're not real controls, they're just drawn to look like controls.
But of course, the toolbar buttons in Windows Explorer do have window handles, they're part of a toolbar. Use the toolbar manipulation functions to interact with them, not EnableWindow.
Or, better yet, use the documented APIs for things like search. Reverse-engineering Windows Explorer has never ended well for anyone, least of all the poor Windows Shell team, saddled with years of backwards-compatibility hacks for certain developers who thought that APIs are for everyone else. Whatever you do manage to get to work is very likely to break on the next version of Windows.
The controls you are talking about are using the ToolbarWindow32 class. If you want to interact with them then you'll need to use the toolbar control APIs/message. For example for enabling buttons you'd want to use TB_ENABLEBUTTON.
You can implement the controls yourself using GDI, OpenGL or DirectX. Try Window Detective on Mozilla Firefox and you will see that there is only one window. Controls in dialog boxes are not windows known to Windows.
Is it possible to develop win32 UI application for Pocket PC with multiple dialogs
we need to display each dialog based on user input and hide previous dialog when current dialog is displayed on window.
Thanks in advance
Sure, that sounds a lot like standard application behavior, which is supported. The only thing not supported is MDI. Programmatically it's going to work just like on the desktop, so examples using calls to CreateWindow or CreateDialog will be applicable.
new Windows 7 hides systray icons by default.
what is the recommended way to show information to users now?
I need to have a small clickable icon visible to user so user can access my "tool" anytime. Should I use the gadget to show my GUI instead? Can it communicate with my Delphi app somehow?
Without more information it's a little difficult to provide a recommendation.
However, I would imagine that a sufficiently important tool, the user would simply keep minimized. They could then use Jumplists to access quick functionality.
For example, Live Messenger uses this setup on Win7.
If your users really like your icon/application they can always choose to not hide your application.
The only difference is that only the user can choose which icon is shown, instead of every application claiming it's "real estate".
In my opinion this is a good functionality and if I were you I wouldn't change the application, just provide a first run GUI which explains how to make your tray icon visible in windows 7.
The entire reason why change was made, was to stop programs like yours. If you need to show information, go ahead and do so. But the notification areas ("systray") is not where shortcuts go. For that, you've got the start menu, desktop and/or the quick launch bar (and please let the user decide).