B2SWindowPunch - vpinball/b2s-backglass GitHub Wiki
B2SWindowPunch is a small command line program which is able to cut holes in application windows using other overlapping (smaller) windows as stencil. You can activate B2SWindowPunch in the settings
You do not need to change or edit parameters for B2SWindowsPunch. The default is already working fine for Visual Pinball, B2S Server together with PinUp Player incl. Freezy´s DMD/alphanumeric display. It will work as is.
Example
B2SDMDWindow showing a standard color DMD
Moving the DMD shows the hole punched in
Deactivate B2SWindowPunch
If you do not want to Punch anything for a certain table, you can amend one line to the tablename.res file, used for this one table:
# By removing the # on next last line, B2SWindowPunch will be deactivated
#B2SWindowPunch=off
In case you want to deactivate the B2SWindowPunch feature completely, there is a setting available under Settings->More.
Video
Advanced users
After VPX triggers the B2SBackglassServer through COM, the B2SBackglassServer.dll calls a small .cmd file B2SInit.cmd
with the name of the table and name of the used rom.
B2SInit.cmd
waits 10 seconds and then it runs B2SWindowPunch:
B2SWindowPunch.exe "^B2S Backglass$|^B2S Backglass Server$|^B2S DMD$" "^Virtual DMD$|^Virtual Alphanumeric Display$|^PUPSCREEN[0-9]+$"
The two parameters shown above are 🌍regular expressions (check 🌍regex101.com) and are used here to select the right windows to punch holes in (1st parameter), and the right windows to use as stencil. (2nd parameter)
B2SInit.cmd also reads a res file called like the table name "tablename.res". If it is found, it will read it and check if the default B2SWindowPunch or cutter (stencil) should be changed. By adding a line saying B2SWindowPunch=new regular expression
or cutter=New regular expression
, they will be changed just for this table. If instead a line saying B2SWindowPunch=off
is added, it will turn off the B2SWindowPunch feature completely for this table.