How to get the main window handle of a process using JScript?
问题 Is there any method in JScript to get the handle of the main window of a process by providing the process name? The Process.MainWindowHandle property works only in JScript .NET. Is anything similar available in classic JScript? 回答1: I am not sure if this works, just try to loop window.parent until its undefined. something like - var mainWindow = window; while( mainWindow.parent ) { mainWindow = mainWindow.parent; } you also have something like window.top which always returns you the topmost