Using python library strange issue

Hi. I found a strange error while using the python library pygetwindow in TouchDesigner. pygetwindow does not work properly when I change the window size of touchdesigner in perform mode. However, when the window size is left unchanged, the pygetwindow function works normally. Could you explain this phenomenon?