Create a transparent window in C++ Using CreateWindow? - c++

Hello people of the internet, I was just wondering is it possible to create a window using CreateWindow and also making is completely transparent? This includes the top bar (where the close and minimize buttons are located, idk what its called) and window it self. So the entire "application" I need to be transparent. If you could help that would be amazing, have a great rest of your day/night!
I was looking at Creating a transparent window in C++ Win32, but it did not work how i wanted it and is very outdated.

Related

Xlib (or gtk). C++. Highlight application's window

I've got application for applications sharing (over network). I need to highlight application's window when it is in sharing state. Currently I use GtkWidget to create border around the window to show that the window is shared. However there are a lot of problems with this approach (need to hide border when application is minimized, need to resize border when application has changed it's size, etc.).
So the question is there any way to show that the window is shared (highlight it somehow or make it flickering or something like that) using xlib (or gtk) API? I didn't find any useful info in the Internet, so I had to ask it here.
Thanks.

Associate a viewer to an existing window under PCL

I am using PCL to display a point cloud under Windows. The CloudViewer and PCLVisualizer classes are available for this purpose. But when you instantiate them, they create their own window (via VTK). As I want to integrate the display window in a complete GUI, I am looking for a way to direct the display to an existing window, possibly by passing the window handle. The window is not OpenGL.
Is that possible ? Any hint ?
It seems that I have found a solution.
Several Web posts suggest to change the parent window of the RenderWindow of the viewer, which can be done with
viewer->getRenderWindow()->SetParentId(hWnd);
Anyway, this doesn't seem to have an effect. But it inspired me to reparent using the Windows function instead,
SetParent((HWND)viewer->getRenderWindow()->GetGenericWindowId(), hWnd);
This indeed makes the viewer a child of my window, while it continues to work correctly. Additional style flags can be adjusted with SetWindowLong.
For now I have also kept the first statement, just in case. It doesn't seem to bother.

How are opengl menus that go outside of the window implemented?

I was looking at how sometimes when you right click, the menu goes outside of the window.
Is this implemented with a separate window? If so, how can I get this functionality. I am trying to use GLFW, but I understand if it isn't possible.
Currently I am on windows, but I like keeping my options open, which is why GLFW would be preferable.
I noticed that GLUT has such a feature. If you are confused to what I am looking at then look at that.
Thanks for any help!!
Overlapping menus (in MS Windows) have to be implemented as a new top-level window, you would have a new OpenGL rendering context and draw the menu in that space - yes, it's a fair bit of work all for the edge-case of a menu overspilling the parent window,
However this isn't often a problem in OpenGL programming because if you're working on a full-screen game then the menu will always be displayed within the main window, and even if it isn't a full-screen a game your users really won't notice them as games tend to use different UI concepts like radial-menus which wouldn't overspill the parent window.
Or if you're working on a non-game title, chances are it isn't full-screen and is going to be an OpenGL rendering area within a larger application that is rendered using a native UI toolkit (e.g. 3ds Max, AutoCAD, etc), in which case no problem: just use native menus.
You can, of course, use native menus in an OpenGL application anyway, provided you do the necessary plumbing for native window messages.

Adding a user interface to an image viewer plugin

I have a general question on how to develop an image viewer plugin with Firebreath. For that, I would like to incorporate a GUI framework, like wxwidget or Qt. The GUI would be used to to fire up some dialogs, adding a toolbar on top, or to open context menus with right clicking an image.
As far as I understand I have a hwnd handle and so I can draw onto a window. I also understand that I have various events I can react on, like mouse button clicks or keyboard strokes. But it fails me how I would add graphical menus, buttons, etc. I know I could use html around the window but that's not the route I like to take.
For instance, does it makes sense to render an user interface offline (in memory) onto an image and then keep somehow track of the state internally?
Has anyone done such thing? Or can anyone give me some insight on how to accomplish adding a user interface.
Assuming you only care about windows and assuming that you don't mind using a windowed plugin, which is the easiest (but no HTML elements can float over the plugin), it should be no different than creating a GUI in any other windows application.
You are given a window that shows up with the AttachedEvent; when DetachedEvent is fired you need to stop using the window. Many people create a child window inside that parent window and use that for all their actual real code which makes it a little easier to use one of those other abstractions, but that's basically all there is to it. I don't know specifically how you'd do it with QT or wxwidget but you'd create a child window of that HWND that you are given and have the abstraction do your thing for you.
As to whether or not it would be rendering things offscreen, etc, I have no idea; that would totally depend on the window system. There is no reason that I know of that you would need to do that, and most things just draw directly to the HWND, but there are a zillion different ways you could do it. It looks to me like what you really need is to understand how drawing in Windows actually works.
I hope that helps

Is it possible to make a window withouth a top in GLUT?

When you make a window in glut using glutCreateWindow it puts a top to the window? What if I want to do some OpenGL rendering without a window top?
This probably doesn't make much sense without a picture:
Essentially I want to remove this from the window.
Use GLUT_BORDERLESS and GLUT_CAPTIONLESS as additional parameters to the glutInitDisplayMode() to get rid of window border and caption as follow:
glutInitDisplayMode(GLUT_RGBA|GLUT_DOUBLE|GLUT_DEPTH|GLUT_BORDERLESS|GLUT_CAPTIONLESS);
At least it works pretty good with freeglut 2.8.1 on Windows.
The proper terminology for what you want is "undecorated window" or "borderless window". Unfortunately, I can't find any GLUT calls which let you control window decorations.
The closest I was able to find was glutFullScreen which, on X11 platforms, is often implemented by maximizing an undecorated window... but it'll re-decorate it if you un-maximize it.
This forum thread seems to confirm my conclusions.