code: function (success, fail, args) {
  		// userargs are encoded and need decoding & parsing into a json object
  		var userargs = JSON.parse(decodeURIComponent(args["userargs"]));
  		// which window handle should we use?
  		var wv = qnx.webplatform.getWebViews();
  		for(var i=0;i<wv.length;i++){
  			if (wv[i].zOrder==0) {
  				// found window handle.
  				success(
  					template.getInstance().execute(
  						{
  							handle:wv[i].jsScreenWindowHandle, 
  							userargs:userargs
  						}
  					)
  				);
  				return;
  			}
  		}
  		fail("error:no window handle");
  	}
docs: execute() finds the window handle, processes userargs then performs the screenshot