How to make an Eiffel Vision2 window always on top? - windows

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.

Related

JavaFX: keep window on desktop

I want to create a desktop widget (windows 10) with JavaFX. Is there any way to keep the window behind all others on the desktop? Also how to prevent it to minimize when clicking the show desktop button, or at least notice it.
After a bit of research it seems to be impossible at the moment to do this with java, although it is possible with the win32api and c++.

Changing z-index of a program

Is there any way for me 2 be able to change the z-index of a program which I downloaded, so it's always on top of whatever is on my screen? Currently it's pre-programmed to be on top of everything, but once I start a full-screen game, it's not on top anymore.
Ps: It's running on Windows 7 (64bit), & it's downloaded here: code.google.com/...
I'd try 2 figure it out from the code but I can't seem to find it, I thought programs on code.google.com are opensource, appearantly not.
No, the point of 'full screen' is 'full screen'. Once a game takes full screen control, usually via DirectX or OpenGL, they've taken over the 'hardware output context', not allowing any more games on top of them.
Many games have the option to run 'windowed' in their video options. That forces the game to remain in regular desktop drawing (at a performance cost) and as such allow interaction with the other windows in the desktop window manager.

Win7 and multiple monitors: switch focus when moving mouse to different monitor?

I recently upgraded to a dual monitor setup at work, and while the extra real estate is very nice, there's one annoyance: my intuitive reaction is that there are two "active" windows now, namely the topmost window in each monitor -- and I frequently get surprised when keyboard events go to the actual active window, rather than the one I've moused over and am looking at.
There's a setting in the control panel that gives this effect (ease of access -> make the mouse easier to use -> activate a window by hovering over it with the mouse) but it also acts on windows within the same monitor, which I don't want.
I frequently use my ThinkPad's scrolling function on unfocused windows which I don't want to receive focus, which come to think of it probably adds to my confusion, since I can scroll my email in the other window but my keyboard shortcuts don't go there.
Is there any way to achieve this effect or am I just wishing?
Thanks,
Ryan
Yeah, get a Mac :-p
In all seriousness OS X does provide this functionality. It might be worth searching for an add on that does the same sort of thing. I know of Wizmouse -- http://antibody-software.com/web/software/software/wizmouse-makes-your-mouse-wheel-work-on-the-window-under-the-mouse/
There might be more though.
AT LAST!!! Windows 10 has this support :-)
SM
You can change the settings to use classic windows appearance etc. and try to focus on the border color of the window. The board changes on the active window.
I use two monitors and there really isn't much you can do besides change your behavior.
Select things from the taskbar, drag active windows to the same screen and always refer to inactive windows by moving them to the inactive windows monitor and remember to go back to the window you want to be active.

How does Microsoft One Note 2010 implement a window that is docked to the desktop?

I just used this feature for the first time - in MS One Note 2010, click on the "Dock to Desktop" button.
The application then literally docks itself to the bottom of the screen. If a window is maximized above it, that window will not overlap or underlap it - the One Note window has become similar to the task bar in terms of its fixed usage of screen real estate.
Come to think of it, I've seen this one other place: the Windows 7 magnifier.
I'm curious to know how this is pulled off? Is it a window attribute that can be applied in a WinForms app or might I have to use the Windows API/C++ to do it? Or is it even trickier than that?
It probably uses SHAppBarMessage; example & a vb6 article simply because it has an illustration.
http://msdn.microsoft.com/en-us/library/cc144177(VS.85).aspx
You will probably have a lot of trouble doing this with WinForms, but it might be possible -- probably, you'll have to do a lot of low level WinAPI stuff with PInvoke to make it work.

How come some controls don't have a windows handle?

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.

Resources