Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var hwndFound = 0;
console.log('NOTEPAD.EXE PID: ' + notepad.pid);
var waitForWindow = function(pid, maxIterations) {
  var i = 0;
  var interval = setInterval(function() {
    console.log('Running iteration: ' + ++i);
    var bool = user32.EnumWindows(windowProc, pid);
    if(i >= maxIterations || hwndFound !== 0) {
        console.log('hWnd is: ' + hwndFound);
        clearInterval(interval);
    }
  }, 0);
  
};
waitForWindow(notepad.pid, 1000);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
xsoulfulxpro
0viewers