Yo,
Earlier today on the chat @mburk asked how one could make a Stride window always on top. Came up with that solution for a project in the past, so I thought I’d share here.
For this to work, you’ll have to :
- Reference
Stride.Graphics.dlldirectly from the vvvv installation folder (this is needed to get theHandlenode, maybe that could be added to the standard node set as Advanced ?) - Create a C# project and add the following Class
public static class WindowHelper
{
[DllImport("user32.dll")]
private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
private static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
private static readonly IntPtr HWND_NOTOPMOST = new IntPtr(-2);
private const uint SWP_NOMOVE = 0x0002;
private const uint SWP_NOSIZE = 0x0001;
public static void SetAlwaysOnTop(IntPtr windowHandle, bool topmost)
{
var insertAfter = topmost ? HWND_TOPMOST : HWND_NOTOPMOST;
SetWindowPos(windowHandle, insertAfter, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
}
You’ll then get this SetAlwaysOnTop node that you can use in a Cache region as shown above.
