READ BEFORE USE
Program Window Display is a mod that lets you display windows in the game. It contains two parts and two commands.
I wanted to make a mod that feeds data to external programs, and use them to draw UI and cockpit objects. However, I failed and didn't want to continue, so this is the half I managed to make. You can still use it to watch VTuber livestreams during long flights, I guess.
! WINDOWS ONLY !
This mod uses user32.dll
and Unity built-in System.Drawing.dll
. There is no platform check, and what happens on Mac is untested.
INFO
"My window is white!"
- Check that the window is open. Open them before entering the level, or you will have to restart.
- Check that the class name and window title are spelt correctly and are an exact match to the window information. If you can get away with leaving one empty (usually the window title), do it.
- Check for
IndexOutOfRangeException
. Increase the size.
"My window is black!"
- If possible, turn off hardware acceleration for the application.
- If not possible, you cannot display that window.
Notice:
- It CANNOT control other applications from the game
- It CANNOT perform remote internet access
Warnings:
- The mod can cause sensitive information to be captured during screen recordings, or written to the log files.
Limitations:
- Windows drawn directly to the hardware (e.g. pretty much every game) cannot be shown. (Read up by searching "printwindow black screen")
- Turn off hardware accelerated graphics on windows you want to show, including Chromium-based browsers.
PARTS
The mod adds the parts "Program Window" and "Unlit Program Window", which use standard and unlit (always illuminated) shaders respectively.
- Class Name, Window Title: Used to find the correct window. Must be a perfect match to the window data. Use the provided commands to find it. Further reading
- Max Size: The size of the texture. It must be a power of two and should be larger than the window you want to capture. If you get
IndexOutOfRangeException
, increase the size. - Update Period: The rate of capture of window contents, in the number of frames.
- Filter Mode: Choose the amount of smoothing applied to the texture.
- Opacity: Global opacity to render a window with.
- Transparency Options: When enabled, colors in the window that are close enough to the defined color will be transparent. A threshold of zero means that only exact matches are turned transparent.
- Display Rect Options: When enabled, pixels outside of the defined coordinates will be transparent. It can be used to hide unwanted contents.
DEMO AIRCRAFT
Notice: Due to device differences, you may need to adjust the display rectangle.
pwdTest
Use with the following Processing PDE file. Try out the transparency and display rectangle options.
Class Name: SunAwtFrame
Window Title: PWDTEST
pwdTest_YouTube
The display rectangle lines up with the video in normal mode.
Class Name: Chrome_WidgetWin_1
Window Title: (null)
COMMANDS
ListWindows (void)
Writes information of all available windows. Click on each entry in the dev console to view the window title, class name, and pointer of the window.
ListWindowsWithName (string)
Writes information of all windows which have the entered string in the title. For example, ListWindowsWithName SimplePlanes
will show all windows that contain "SimplePlanes" in the title.
REFERENCES
(i.e. some code copied from the following webpages)
@UberAte it is a hardware-drawn window, so it's incompatible with this mod
@hpgbproductions Im really trying to get this to work lol, I dunno man. I tried streaming my browser, typed in the exact window/class name found in the dev console, gave me a white screen. Tried streaming "SimplePlanes" (class name was UnityWndClass), gave me a black screen. Think you can make a quick screen recording, dont know what im doing wrong xd
@UberAte
1. Look at name of window at the top of the window
2. Use dev console command to search for it (see COMMANDS section)
3. Type the class name in the part. Must be exactly correct including upper/lowercase. Window title is optional, but if you happen to have multiple windows with the same class name, this will select the correct one.
4. Set the window size larger than the window (just guess using your monitor resolution)
5. Test it (see INFO section for FAQ)
Can someone make a tutorial on how to get this to work? instructions aren't clear to me.
Certified doog moment
@hpgbproductions fun
@PostalDude failed to make external flight display, but can watch vtubers and anime during long flights
why tho
Been having way too much fun with this mod, even though the video quality isn't as good as the source. Something about the novelty of the experience, pretty fun.
Hey do you think you can make a version of this that just plays video file instead of streaming a window?
roleplaying purposes (that could actually become true one day)
What happened @se34ruy
oh i cant wait for mp screen sharing. (days later) oh god that was the biggest mistake of my life
@FujiwaraAutoShop use the dev console command ListWindowsWithName to find it
How do i know my window's "Class name"?
Gonna start playing War Thunder in SP
Using MGR as an example is great, ngl
I see koron I updoot
so.... you can watch a live stream... in simpleplanes
We can play SP in SP. Finally. Thank you for this masterpiece, I shall never be able to use it though. DAMN YOU APPLE.
I hope I had a powerful pc so I can enjoy this masterpiece
Finally I can watch some wholesome anime while committing warcrimes!
@PyrrhaNikos and then play SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP in SP
@Johnnyynf and then play SP in SP in SP
Nonetheless this is pretty cool
Manages SP account in a middle of an auto plane flight in sp.