bool SetOwnerWnd(int, int)

Sets new window owner

Security

Trust Level Required: Full Trust

Parameters

Name Description
hWnd int
The handle of the window
hWndNewOwner int
The handle of the new owner of hWnd

Return

True on success

Remarks

IMPORTANT: While KioWare can be used to open 3rd party applications it cannot guarantee any security of your kiosk while these applications are in use.

It is also possible to show a taskbar with all open apps via the User Interface section of the Configuration Tool. With KioWare running in shell mode, as is recommended, the start menu will still be disabled.

Examples


var cmd = 'notepad.exe';
var wnd, pid;
Run(cmd);

function Run(cmd)
{
	if(!pid || !KioUtils.IsProcRunning(pid)) 
	{
		wnd = 0;
		pid = KioUtils.Execute(cmd);
	}
	if(pid) setTimeout(Check, 500);
}

function Check()
{
	if(KioUtils.IsProcRunning(pid))
	{
		if(!wnd) wnd = KioUtils.GetProcMainWnd(pid)
		if(wnd)
		{
			//Makes KioWare the owner of the new window
			KioUtils.SetOwnerWnd(wnd, KioInfo.MainWindowHandle);
		}
		else setTimeout(Check, 500);
	}
	else pid = 0;
}

Requirements

KioWare for Windows version 8.5 or greater.