For security reasons, I have changed the Windows shell to a custom application I wrote. I have created a bar at the bottom of the screen similar to the Task Bar that I currently call a status bar since it doesn't hold icons to select tasks. My main question is this:
Can I make this status bar take up its screen space such that other applications will not render themselves under it? Note that I've already set it to be Always on Top, which works great, except that other windows show up under it.
For example, if the screen is 1680x1050, can I make this status bar take up the bottom 50 pixel rows of the screen, but have Windows then tell applications that the screen is 1680x1000 (which is what I assume happens when using the actual Windows Task Bar)?
A related question:
Can I alternately somehow extend the actual Windows Task Bar such that I get all Windows Task Bar functionality, but control exactly how it behaves? Maybe via a Task Bar subclass?
Use SHAppBarMessage(). See example in article. To related questions - no public API.
Related
I try to grab specific windows on Windows 10. I read some articles from MSDN to get familiar with APIs. My goal is to grab some certain windows, even if there are some windows on top of them (equivalent to OS X CGWindowList API). So if there are 2 windows: A and B, and windows B partially overlaps window A, I would like to be able to capture window A content, without capturing window B that partially covers window it.
According to this link, there are 5 different ways to capture the screen, if I understood them correct, most of them can capture only some regions on the screen, i.e. they don't distinguish between windows. The only API which allows to grab specific windows is "old standby, GDI".
I tried to acquire windows' device contexts using GetWindowDC() function, create a compatible bitmap and then use bit block transfer (BitBlt()). However, it seems that it does not always work as expected.
I've noticed several problems on Windows 10 (did not test on other operating systems):
Window's title bar usually is not captured. I tried to open Notepad and capture the window, but it was not fully captured, part of the scroll bar was not captured as well as a title bar. I tried to capture child windows of Notepad, but it did not work as expected, moreover some child windows are seem to have coordinates which seem to be wrong (the msctls_statusbar32msctls_statusbar32 child window of Notepad had the width which was 3 times bigger than the actual width of the window).
Some apps are not captured at all. For instance applications like "Photos", "Calc", "Settings" are not captured with that approach, when I try to capture them I get a black bitmap. There should be an API which allows capturing such windows, for instance TeamViewer is able to capture those Windows. It seems that all such windows are rendered by ApplicationFrameHost.exe process.
Does anyone know how to solve those issues?
I am looking to write a small application that will reside as a button on the Task Bar in Windows (it's fine if it is only compatible with Win7+), but I cannot figure out where to start to to put a widget onto the task bar itself.
See this attached image, taken from an HP laptop where the custom support center is overlayed on the task bar:
Note, this is not a standard application icon that exists in the system tray. Nor is it your standard taskbar button, i.e. a pinned shortcut. It is a custom program of some sort that registers this item on the task bar. I've seen similar things on other machines where the battery indicator is there, and has the current charge (before Windows 7 added an icon for that).
I am looking to position an interactive element at the start of the task bar like this one (only in a different position, more left, next to the start button). I have been looking high and low for documentation to help me get started with this element, and I cannot find anything. Can anyone provide a hint on how to get started?
I can write in C#, C++, whatever, so just a pointer to the right spot would be great. Thank you.
I have a desktop application written in Ruby that is using GTK2. It's just a small test application to play with GTK2, but I'm having problems achieving what I want to do. Is there any way using GTK2 to get at the titlebar (apart from setting the title), specifically to either add a button to it (beside the min/max/etc, B in the below diagram) or to add an option to the menu that pops up when you click the icon on the titlebar (A in the below diagram)?
I'm thinking there might not be because GTK is meant to work with many many different window managers, but I just wondered if there was. As a side question, what event does clicking the 'cross' button fire? At the moment if the user clicks that the window disappears but the program doesn't end - I need to capture that event and quit the program.
Thanks for any help, including hitting me over the head and telling me how silly I am.
Note that this is possible in GTK 3.10 and up, by using gtk_window_set_titlebar(). It replaces the window manager's title bar with a custom one. GtkHeaderBar is a good custom title bar class to use.
You can't, however, make it look just like the window manager would, because you won't know which window manager the user is running.
No, the title bar is owned by the window manager and you will typically not have direct access to it.
When the user tries to close the window by clicking the window manager's button, the window will receive the delete event.
I'm wondering how to dock / snap a window to the side of the screen in Windows, preferably with straight Win32 API. The effect I'm looking for is like the task bar -- a window that has a reserved space on screen, so that maximizing another window makes that window take up the rest of the screen, but leaves my window in place and visible.
I know various IM clients do this, but haven't been able to find any resources on how to do it. Not sure what the appropriate name for it is either.
Edit: "Application Desktop Toolbar" is the search term to use to find info on this.
IIUYC you're looking for an app bar (MS-officially "Application Desktop Toolbar"). You can indeed create these with the Windows API.
"App Bar" - you turn a window into an App Bar by sending the ABM_NEW message. Examples on MSDN:
http://msdn.microsoft.com/en-us/library/cc144177(VS.85).aspx
http://support.microsoft.com/kb/134206
I've seen a few Windows 7 applications popping up around the web that take advantage of the new task bar functionality. However, some of these applications are treating the task bar like the notification area. There is no foreground window. All interaction is done through the task bar button (with overlays, progress bars, jump lists, etc).
Personally, I like the new task bar more than the notification area because I have the ability to use larger icons and give the user a very familiar user interface with a rich experience. But I also feel like applications like those described above should be kept in the notification area.
What do you think about applications that use the Windows 7 task bar as the "new notification area"? Should it be avoided?
Microsoft is doing its best to discourage use of the 'notification area', frequently referred to as the 'System Tray'. Instead they encourage more detailed and interactive application icons. For example, the progress bar that's visible on the explorer icon when you're performing file operations in the explorer.
Read the windows user experience interaction guidelines for more details on the new recommended functionality.