Hi
if i have more than 1 window in my app , how can i get the
openframeworks window to be the TOPMOST ???
thanks!!
Hi
if i have more than 1 window in my app , how can i get the
openframeworks window to be the TOPMOST ???
thanks!!
is this on a mac, pc, linux?
there are system specific ways to do it on each…
take care!
zach
I’m working on a PC.
here is code for making it top most again, but it can change. there is also a way to make it fixed, (like photoshop’s loading panel) but that’s with the window styles, there some code here for that:
http://www.openframeworks.cc/forum/view-…-windowlong
fyi this is the call to make the window topmost again:
HWND hWnd = WindowFromDC(wglGetCurrentDC());
::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0 , 0 , 0, SWP_NOMOVE | SWP_NOSIZE);
if you call this code, every so often, the window pops back up to the top (even if it looses focus), ie:
if (ofGetFrameNum() % 100 == 0){
HWND hWnd = WindowFromDC(wglGetCurrentDC());
::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0 , 0 , 0, SWP_NOMOVE | SWP_NOSIZE);
}
it’s slightly annoying but it could be useful for what you need to do… (either do it through the winow style, or this way, by getting the hwnd and manually making it topmost) I guess there is another windows call to get focus back.
hope that helps!
zach
Huh - I didn’t know about that method for getting a window handle.
I think with that approach we could fix the [x] button on windows. The problem with the previous code was in getting the window handle
I’ll give it a shot when I have a chance - here is the link to the rather ridiculous way I was trying to get the window handle.
http://forum.openframeworks.cc/t/stopping-application-on-window-close-with-of-window/22/13
Theo