Creating a "hole"/"see-through" object in a Windows app in Xojo

Hello All,

Would it be possible for me to create a Windows application with a “hole” in one of the windows/dialogs, effectively making it possible to see other Windows’ & applications’ objects through that “see-through object/hole”?

Thanks in advance for any inputs.
-Simon @ Nashville, Tennessee

Xojo Windows apps do not support transparency any more.

Maybe by using an Overlay window?

There is an example with a few declares that comes with Xojo but does require specifying a transparent colour

Please check out OverlayMBS class and SetWindowMaskMBS function in MBS Plugins.

That’s unfortunate. Thanks, Tim!

An overlay window? That sounds interesting. Thanks, David.

I am sorry if I overlooked this one example you are referring to, Steve. I’ll check out further. Thanks for the tip.

As always, you seem to have solutions waiting for my problems, Christian. I’ll check out your OverlayMBS class. This would be a good reason for me to finally purchase one of your products! FYI, I’ve been tempted to do so with some of your products, but I always waited until later… This might be the time… Thank you so much for the direction!

1 Like

Great. Maybe start with a trial license.

I am curious, Christian, the example codes shown on your website are simple to understand, just like an in old-fashion programming codes I am also familiar with (such as Java, Rexx, etc.), in plain texts.

My questions here:

  1. How do you add the GUI components into the codes, if there are any (such as a dialog, and other objects within the dialog)? Is there a special editor that I can use with a window builder add-on (similar to that in Eclipse, perhaps)?
  2. How do you invoke the Xojo compiler/builder from a (Windows’ CMD) command line to create the executable (for Windows O/S, in this case)?

Thanks in advance for any info on this.

Well, setting window mask should work with a normal Xojo window including controls.

The overlay one is a custom thing, where you can draw into the picture as needed and draw your own controls if needed. And then handle mouse clicks. It is not really for regular controls.
We use it for custom stuff like a ruler, an utility display for some values or to draw a selection rectangle.

Hello Christian,

If your post was meant for me, obviously, it was beyond my level of comprehension. In short, I do not understand it. FYI, I am not a sharp person.

BTW, just in case my initial question was not clear, I am trying to create an Windows application, imagine a window, with in it a “hole”, through which I can see Windows (O/S), desktop and/or other applications’ objects (such as the icons on the desktop, etc. Think of a donut or a bagel, through which hole you can see things “behind” it. Or, perhaps this Shanghai World Financial Center - Wikipedia , through the hole within the building you can see the things on the other side. :slight_smile:

Could you download MBS Plugins?

Then copy our Win Plugin into your plugins folder.
Then launch Xojo.
Open the examples Win/Window Mask and run it.
Click button.

Does that work for you?

Screenshot here:
Bildschirmfoto 2023-10-20 um 22.00.42

Thank you very much, Christian!

Using your snippets of codes, I built the following prototype app (called See Through Window):

The codes used are as follows:

Dim borderwidth As Integer
Dim p As Picture
p = New Picture(Width+borderwidth+30,Height+60,32)
p.Graphics.FillRectangle(11, 34, 298, 270)
If Not Self.SetWindowMaskMBS(p,True, RGB(0,0,0)) Then
End If

Is this the right MBS Xojo Plugin for me to purchase for this?

MBS Xojo Complete Plugin Set

-Simon in Nashville, Tennessee

Great. Yes. Just buy the package and you get 40+ plugins.
Including Overlay which may also be handy for something similar.

1 Like

I think I’ve found the answer to my own question #1 here.

By chance, I found this page: Project file information — Xojo documentation

My tip to those who wants to save the project in type “Xojo Project”, create a subdirectory/folder first, and then save your “Xojo Project” (created many files) in there.

-Simon in Nashville, Tennessee