Minimize main windows via script

I want show video, that stored outside my biuld. I call script, wich open video using my player. But main app windows stay on top (option set in publication settings and it must be enabled) and it overlaps video.
Is there way programmatically minimize main app window? Using HEScript or JS from my html page?

You can use the same code as shown here:

I modified this script, because it show Syntax Errors.
New script:

function GetActiveWindow : LongWord; external "[email protected] stdcall";      
function ShowWindow(hWnd : LongWord; nCmdShow : LongWord): LongWord; external "[email protected] stdcall";

procedure Minimize;
var    hWnd : Longint;
hWnd := GetActiveWindow();
ShowWindow(hWnd, SW_MINIMIZE);

When I call Minimize, i resieve Runtime error:

How correctly load external dll?
In samples for Deplhi linking make like in this sample:
function GetWindowTextW; external user32 name 'GetWindowTextW';

Or like this:

function GetWindowDC(Wnd: HWnd); HDC; 
stdcall; external 'user32.dll' name 'GetWindowDC';

I try load in this style:
function GetActiveWindow : LongWord; stdcall; external "user32.dll" name "GetActiveWindow";

But in htmlExe script editor show syntax error.

Or need do something else?

It’s a strange syntax here. Try with
external "user32.dll" name 'GetActiveWindow'
Note the different " and ’ characters… :pensive: