Skip to main content

[C#] Detect and close a specific popup window.

When you need to detect and close a specific window, you can do using AddAutomationEventHandler method in the namespace System.Windows.Automation. 

  • Set Hook

line 4, set identifier for window open event which want to detect.
line 7, set event handler  
  • Set Event Handler
line 8, compare name of element with the name to find.
line 15, print the contents of the window
line 22, find the "No" button, it's name has a character "N".
line 24~25, push the button.

Comments

Popular posts from this blog

[Godot engine] How to set the AnimatedTexture to the TextureButton node

In the Godot engine, the TextureButton can use a variety of textures. In this post, I'll show how to set an AnimatedTexture to the TextureButton node. The AnimatedTexture shows an animation effect using the image frames. To do this, I prepared simple images as a frames of the animation. I create a "images" folder to save the images. Godot engine have to import these images to use. The importing is done by drag and drop.  Add TextureButton node to the Scene. The texture list to set will be shown when you select inserted TextureButton, expand Textures menu in Inspector tab in right side of editor. I'll set AnimatedTexture in the Normal case, because I want to show text animation all the time. I Selected "[empty]" drop box beside Normal and select "New AnimatedTexture" menu. There are 5 imag