how to keep processing output window always on top - kinect

I am currently making a project on kinect using SimpleOpenNI and Processing and am new to it.
I want to know how I can keep my output window always on top...even when i switch focus to some other application like powerpoint or vlc??

Try frame.setAlwaysOnTop(true);. It's from the Window Class, but processing's frame variable is an AWT Frame, which extends Window.
Documentation

Related

Set focus to child window in PyGtk

I am writing a simple application in python using PyGObject and glade. The application has a main window and a functional window (Generate logs, also a Window object) which opens up on clicking a menu item.
The Generate logs window is supposed to:
Show options to generate log for a particular date
Be minimizable and should close automatically when the task is complete (OR)
Be able to be closed manually if the user wishes so
The problem is, once I show up the Generate logs window, I am directly able to select the main window as well. Then, I can go to the menu and bring up as many Generate logs windows as I want.
I have tried several options (Is Focus, setting up main window as Transient parent etc) but nothing worked. How can I fix this?
First you say PyGTK, then you say PyGObject, this are 2 different things. I'm going to answer for PyGTK (my sources are from GTK+ 2 docs) since it's in the title and maybe people looking for that will end up here. But never fear, because for this question, the answer is practically (I think exactly) the same for both.
What I understand is that you want you "Generate log" window to be modal. That means other windows can't be used while your modal window is up, just like a Dialog window. Also you should set the main window to be the parent of your modal window, since this helps the OS Window Manager i.e. keep the dialog on top of the main window.
Yo can do both of this things directly from Glade (if you've created both windows in the same project, not always the case) selecting the Modal atribute to True and the Transient for Window attribute to your main window, in the General Properties section of your Generate log window.
Also you can do it programmatically using the set_modal() and the set_transient_for(parent_window) method of your child window.
Let's say your parent window is called main_window and the child window is generate_log_window, then you can do it like this:
generate_log_window.set_modal(gtk.TRUE)
generate_log_window.set_transient_for(main_window)
If you want it to show center top of your main window, do this
generate_log_window.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
To your second point, the ability to minimize can be set from Glade.
Sources:
GTK+ 2 GtkWindow reference set_modal
GTK+ 2 GtkWindow reference set_transient_for
PyGTK FAQ: How do I get my windows to show up where I want
PyGTK FAQ: How do I make a dialog block the whole application, so the user is forced to answer it?
create several windows (see your other post).
Upload them in init
Show them with "signals" in glade using "show" and "hide"
class GUIxxxx
#...
def action1(self, widget, data=None):
self.window1.show()
def action2(self, widget, data=None):
# do something here
self.window1.hide()

display a popup inside external application

I'm developing an application in which, if I press a combination of keys shows me a popup inside the form of another external application, I mean something like the "windows game menu", but I have no idea how to show the popup in the external application. I leave you an image to make you understand what I mean as a popup. sorry for my english but I do not speak.
Thanks in advance
You cannot control one application form of another application without having access to its code or knowing if a queue messaging command has been set for doing it.
It is possible to program a window of your application to be shown over any other , likely this will not be working over a Directx - OpenGL full-area, i.e. when you are playing a videogame that is using the same functionality because the last one is winning.
In this case your popup will be visible barely as a flick, but considering standard form application you can make it to stand over by working with userd32.dll method
"SetWindowPos" with the flag HWND_TOPMOST.
You will need first to detect the position of the application window, or if it is a fullscreen one you can simply detect the size of the screen and consider to place it in the center, then you can set the position of your application form "pop-up".
Details about the SetWindowPos , which is among windwows base dll but can be invoked from .net here below:
https://learn.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setwindowpos
Make a window topmost using a window handle

Separate layers for printing in console output window

I'm developing a custom logger for MSBuild (C# project) to track the progress of building a big solution file. I want to show the progress in a fixed position in the command window (say top-left), while normal build messages are being printed out. Ideally, this can be accomplished by printing the progress in a fixed position, on a 'transparent' layer which sits on top of msbuild messages layer. However, my brief search didn't result in anything similar to what I wanted.
Does anyone have a suggestion/workaround for this?
Thanks
I've done something similar by programmatically creating a simple WinForm with a ProgressBar, i.e. when building locally (Environment.UserInteractive) show the progress bar (STAThread) otherwise just log normally, e.g. when built by CI.

Is it possible to attach my window to a window of another application?

On Windows we can find the window handle of running process and attach our window onto it as a child window, so the two different processes look like the same one.
I wonder if there is a similar way to implement this requirement in cocoa.
This is possible using code injection. Have a look at mach inject framework and PorcShark Finder.
Or
Find position of another window using CGWindow methods and display your window over it.
Have a look at Son of Grab sample project.
Son of Grab shows how to use the new CGWindow API to get images of arbitrary sets
of windows, including images of the current contents of the screen.

getting position (x,y) , width and lenght of Lotus Notes window in vb.net

I'm trying to get the starting position (x,y), the width and the lenght of a Lotus Notes application window from a vb.net application.
so far, I've tried using Process to do the trick but I can't figure out what to use after finding the good process in windows running process list. The only "usefull" thing which use or see the UI is the Process.MainWindowTitle. It does give the title of my Notes Window but As I said, I want coordonates, width and lenght.
I also tried using back-end classes: COM object lotus and domino
But nothing in those have necessary stuff to fill my needs.
I would also need the state of the window, something like
SHOWNORMAL
HIDE
RESTORE
SHOWMAXIMIZED
SHOWMINIMIZED
...
EDIT
I want to get the position of the window to modify the position of my application. Also I want to resise and modify the position of the Notes client. My goal here is to make both of my application and the Notes client fit in the screen.
Any help is very apreaciated!
I did something like that using the Windows API some years ago. Right now, I got no examples about that, but what I did it was this: get the handler from Lotus Notes window, and then, get the handler from an embedded view, and simulate a click event to set the focus in it.
You can use the WinAPI, but that's not necessarily the best approach. You should consider other alternatives as Karl-Henry Martinsson says.