Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

29
LINES

< > BotCompany Repo | #1006666 // autoVMExit_visibleObjects

JavaX fragment (include)

static int autoVMExit_visibleObjects() {
  int objectCount = 0;
  
  // Scan for windows

  Map unimportantWindows = cast vm_generalMap_get("unimportant windows");
  Window[] windowList = Window.getWindows();
  for (Window window : windowList) {
    if (window.isVisible() && !containsKey(unimportantWindows, window))
      ++objectCount;
  }

  // Scan for tray icons

  try {
    objectCount += SystemTray.getSystemTray().getTrayIcons().length;
  } catch (Throwable e) {
    // ignore
  }
  
  // Scan for JavaFX stages
  
  try {
    objectCount += l((L) call(_getClass("com.sun.javafx.robot.impl.FXRobotHelper"), "getStages"));
  } catch {
  }
  
  ret objectCount;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006666
Snippet name: autoVMExit_visibleObjects
Eternal ID of this version: #1006666/4
Text MD5: 992376383e32f3d50b67990b012ae648
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-11 10:26:52
Source code size: 699 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 421 / 428
Version history: 3 change(s)
Referenced in: [show references]