for a small project (planned to run on OS X and Windows) I’m in need for a window that always stays in foreground globally (even overlapping other apps, but allows them being used).
My intention was to use a “global floating window”, but I need to get rid off the window title and buttons (OS X) as well as the surrounding frame (on some Windows versions). Ideally, it would look like a “plain box”, but this one doesn’t stay in the foreground.
Is there a way to create a window of type “plain box” (or similar) that remains globally in the background ?
How would you move your plain box? I would be extremely annoyed if some app’s box would obstruct my app’s windows
I think you’ll need to use declares or plugins to get this customized behavior.
To get rid of the titlebar on mac cocoa use this in a Regular Document Window.
[code]dim newStyle As UInt32 = 0 //no titlebar, not resizeable
if self.Resizeable then newStyle = 8 //no titlebar and resizeable
soft declare sub setStyleMask lib “Cocoa.framework” selector “setStyleMask:” (id As Ptr, mask As UInt32)
soft declare sub setLevel lib “Cocoa.framework” selector “setLevel:” (id As Ptr, windowLevel As Int32)
setLevel(Ptr(self.Handle, 5) //make it float[/code]
Called from a pushbutton the titlebar disappears, and the drop shadow stays. Called in the Windows open event the titlebar is gone but there’s no drop shadow. Not sure why the diff. Sure the shadow could be turned back on in open or something, needs more investigation. And you’ll need to investigate how to do this for Windows OS.
For all the cocoa window options see NSWindow …or checkout macoslib.
For plugins I’d bet MBS has these options and for windows too.
Got the setLevel parameter value from here
Also note, I think if you set the no-titlebar style you’re not supposed to use any of the other choices, like resizeable, but it’s working for me.
@Markus: The window will be placed on the screen in a way that it is almost hidden. Once the window becomes touched with the mouse pointer, it pops up in full size.
@doofus: Thank you very much for taking the time to provide me with an example. I’ll give it a try and do some research of my own, although I hoped that I can avoid declares. Anyway, better than using plug-ins, this is no option.
Thank you Stuart,
that was exactly what I was looking for!
Now I need a similar solution for Windows…