Question / Help Projector always on top?

Sou

Member
Is it possible to make projector always on top? I don't mean only windows, as far as I remember I never had problem with mouse cursor over projector in OBS classic, in OBS studio it is frequent. If it is not possible via OBS classic settings maybe I could use some win10 solution?
 

Suslik V

Active Member
Can you post log-file with your issue? And, please make screenshot of the problem or describe more, what is wrong with your cursor appearance.
 

Sou

Member
When you have projector on second screen the mouse cursor is on top of the projector... that's it:) So from time to time you can accidentally move the mouse cursor over projector "window".
 

raholl

New Member
Hi Sou,
for the purposes you describe, i am using a powershell script. Powershell is part of windows so you usually dont need to install anything.

Here we are using user32.dll to get a window handle and then we use SetWindowPos to change window appearance.

File: alwaysOnTop.ps1

$signature = @’
[DllImport("user32.dll")]
public static extern bool SetWindowPos(
IntPtr hWnd,
IntPtr hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
uint uFlags);
‘@
$type = Add-Type -MemberDefinition $signature -Name SetWindowPosition -Namespace SetWindowPos -Using System.Text -PassThru

$handle = (Get-Process "OBS Projector Window").MainWindowHandle
$alwaysOnTop = New-Object -TypeName System.IntPtr -ArgumentList (-1)
$type::SetWindowPos($handle, $alwaysOnTop, 0, 0, 0, 0, 0x0003)

If you save the code above to the a file and run it with powershell, it will set projector window "always on top", so that no other program should appear above it anymore...

It is not persistent setting = you may have to run the script again if you close and reopen the window and/or OBS.

I hope it helps...


EDIT: you will need to set execution policy to Unrestricted or you will need to sign the scrpt with your signature and set execution policy to Remote-Signed.

More information you can get here (sections 10. and 11.) - LINK

TLDR: you can quickly bypass security settings and allow your windows to run powershell scripts via command "set-executionpolicy unrestricted", but you should know what you are doing and you should not do it on production machine (do it like that for test purposes only).
 
Last edited:
Top