Make a windowed projector (source) dockable for example my camera or a two window multi-view.

mattbatt

Member
To confirm my PTZ camera is pointing in the right direction when it's not on screen I am using "Windowed Projector (scene)" which was a revolutionary help and I thank whomever made that work. Now I'm getting greedy and I'd like to dock it so that it's always in the right place when I load OBS. This could be useful for other sources as well. Yes I have already selected "Save Projectors on exit" and that works but I either have the option of "always on top and always in the way" or "where the hell did that window go". I guess what I really want is a two window multi-view one tiny showing my camera source at all times and one big showing program. I use my scenes like a playlist for our church service so there are 24 of them in the main stack and about 10 more that are useful.
 

Mango

Member
Here's an AutoHotkey script that makes the projector windows Always On Top, only when OBS is active. It would be better if they were dockable, but I don't know how to do that, and this is better than nothing.

Code:
#SingleInstance Force

; Make OBS Windowed Projectors always on top only when OBS is active.

Loop {
 ; Wait until OBS is active.
 WinWaitActive, OBS
 ; Get the list of Windowed Projectors...
 WinGet, ProjectorList, List, Windowed Projector
 ; ...so we can loop through them.
 Loop, %ProjectorList% {
  ; Restore this projector.  Results were less predictable without this.
  WinRestore, % "ahk_id " ProjectorList%A_Index%
  ; Set AlwaysOnTop.
  WinSet, AlwaysOnTop, On, % "ahk_id " ProjectorList%A_Index%
  }
 ; Now, activate OBS again because it got deactivated above.
 WinActivate, OBS
 ; Wait until OBS is NOT active so we can turn off Always On Top.
 WinWaitNotActive, OBS
 ; Note what window is currently active because we'll need to move it above the windowed projector later.
 WinGetActiveTitle, Title
 ; Probably best to do this every time in case new projectors have been open.
 WinGet, ProjectorList, List, Windowed Projector
 ; Loop through the projectors again.
 Loop, %ProjectorList% {
  ; Turn off AlwaysOnTop.
  WinSet, AlwaysOnTop, Off, % "ahk_id " ProjectorList%A_Index%
  ; Do this because otherwise it disappears.
  WinSet, Top,, % "ahk_id " ProjectorList%A_Index%
  }
 ; Now bring the window the user actually wants to the top.
 WinSet, Top,, % Title
 }
 

Attachments

  • Conditional AlwaysOnTop for OBS Windowed Projector.zip
    383 KB · Views: 14

Mango

Member
Another way to do it is this: (significantly less-elaborate code; add the loop in if you want it)

Code:
Win_Hwnd := WinExist("OBS")
Prj_Hwnd := WinExist("Windowed Projector")
WinSet, Style, -0x80000, Windowed Projector
DllCall("SetParent", "uint", Prj_Hwnd, "uint", Win_Hwnd)
 
Top