int GetWndProcId(int)

Returns the process id to which a window belongs


Trust Level Required: Full Trust


Name Description
hWnd int
The handle of the window


The process id, or 0.


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.

Window titles and class names can be typically be found in the menu bar of the window, or by using utilities such as Spy++.


var pid
var wnd = null

if(!pid) pid = KioUtils.Execute('notepad.exe')
var wnd = null
while (!wnd) {
	wnd = KioUtils.GetProcMainWnd(pid)
//If the above code is run from an external source or CustomToolbarCode.js, then you can 
//find the window with Javascript injected from the Configuration Tool:
var pid
var handle = KioUtils.FindWnd('Untitled - Notepad', 'Notepad')
if(handle > 0) pid = KioUtils.GetWndProcId(handle)
if(KioUtils.IsProcRunning(pid)) KioUtils.KillProc(pid)


KioWare for Windows version 8.12 or greater.