Download

Change position of window ingame

Hi,
Is there any execute command to change position of the game window for e.g. via blueprints?

I need it that way, because I activate “Enable HWMD”(VR Head set) via blueprint.

BUMP this post

When I use exe parameters, window goes back to center of the screen after game activate “Enable HWMD” command…

BUMP still can’t find any solution.

Maybe there is some kind of way to set position of VR Game window in specify position?

Hi!
This can easily be done using a little c++ and exposing it to blueprints.

Example:
if (GEngine && GEngine->GameViewport)
{
FVector2D WindowPosition = FVector2D(400.f, 300.f);
GEngine->GameViewport->GetWindow()->MoveWindowTo(WindowPosition);
}

Oh, I used outside program writen in cpp to make it, but this solution is so much better.
Thank you very much!

Hey!
I had a similar requirement and found an alternative solution:




#define WIN32_LEAN_AND_MEAN

#include "Placeholder_Library.h"
#include "Windows.h"
#include <string>
#include "GenericPlatform/GenericWindow.h"

void UPlaceholder_Library::MoveMainWindow(float newXPosition, float newYPosition, float newWidth, float newHeight)
{
    HWND hwnd = GetActiveWindow();

    if(hwnd)
    {
        UE_LOG(LogTemp, Warning, TEXT("FOUND the handle"));
        MoveWindow(hwnd, newXPosition, newYPosition, newWidth, newHeight, true);
    }

    else
    {
        UE_LOG(LogTemp, Warning, TEXT("Found no handle"));
    }
}



Hope this helps some others