@@ -826,7 +826,8 @@ def _child_search_by_path(
826826 if found :
827827 if switch_window :
828828 CommonUtil .ExecLog (sModuleInfo , "Switching to window: %s" % NameE , 1 )
829- autoit .win_activate (NameE )
829+ if Shared_Resources .Get_Shared_Variables ("zeuz_window_auto_switch" ).strip ().lower () in CommonUtil .Affirmative_words :
830+ autoit .win_activate (NameE )
830831 all_elements .append (each_child )
831832 if 0 <= element_index == len (all_elements ) - 1 : break
832833
@@ -1627,15 +1628,17 @@ def _get_main_window(WindowName):
16271628 if MainWindowElement .Current .ProcessId in current_pid_list :
16281629 CommonUtil .ExecLog (sModuleInfo , "Switching to window: %s" % NameS , 1 )
16291630 CommonUtil .ExecLog (sModuleInfo , f"pid matched: { MainWindowElement .Current .ProcessId } " , 5 )
1630- autoit .win_activate (NameS )
1631+ if Shared_Resources .Get_Shared_Variables ("zeuz_window_auto_switch" ).strip ().lower () in CommonUtil .Affirmative_words :
1632+ autoit .win_activate (NameS )
16311633 return MainWindowElement
16321634 else :
16331635 found_windows .append (MainWindowElement )
16341636 except :
16351637 pass
16361638 if len (found_windows ) > 0 :
16371639 CommonUtil .ExecLog (sModuleInfo , "Switching to window: %s" % found_windows [0 ].Current .Name , 1 )
1638- autoit .win_activate (found_windows [0 ].Current .Name )
1640+ if Shared_Resources .Get_Shared_Variables ("zeuz_window_auto_switch" ).strip ().lower () in CommonUtil .Affirmative_words :
1641+ autoit .win_activate (found_windows [0 ].Current .Name )
16391642 return found_windows [0 ]
16401643 return None
16411644 except Exception :
0 commit comments