WIndows GUI Automation in a minimized window

As a disclaimer, I am not at all familiar with the development of Win32. I was wondering if there is a way to automate the input of control into a GUI application if this application is minimized. Most of the automation tools that I saw specifically use coordinate offsets from the window (tlx, tly). I don’t need a testing framework, I just want my own application to trigger some actions in the application with minimal (other than closed source). I say this, the less it seems possible. Any input is evaluated how this can be done.

+3
source share
3 answers

Well, the easiest way to get to know the default minimization behavior is to play with something simple, for example. Calculator. Just run it and use Microsoft Spy++it to see the properties of the window representing some button in the calculator window.

In my case, I see:

  • in normal condition: rectangle (1096, 222) - (1130, 249), 34x27
  • in minimized state: rectangle (-31911, -31839) - (- 31877, -31812), 34x27

Thus, by default, minimizing changes the position of the window, moving it far away. If you were able to save the HWND, you can still send any window you need.

Things to remember:

  • Applications
  • can customize their behavior while minimizing, for example. completely destroy the window - switch to the tray.
  • - - , IsWindowVisible, , ..
+3
0

Python - pywinauto.

: Python - pywinauto,

, WinForms , , (Click method), .

0

Source: https://habr.com/ru/post/1771933/


All Articles