This article describes a Python implementation method that invokes a window based on a window caption. Share to everyone for your reference. The specific analysis is as follows:
When you know the title of a Windows window, you can use the following code to call the window, or even write to the window inside the content.
#-*-coding:utf-8-*-import win32gui,win32con# The following is the title name of the window, so it must be wrong, but in the console can be used normally # written in a file to use the U code a=u "Bitscn.com" dlg= Win32gui. FindWindow (NONE,A)//Use the control's ID to get a handle to the control, simulate writing the input box text and press the Submit button T1=win32gui. GetDlgItem (dlg,1012) T2=win32gui. GetDlgItem (dlg,1001) K1=win32gui. GetDlgItem (dlg,1605) Win32gui. SendMessage (T1,win32con. Wm_settext,none, ' 902723 ') Win32gui. SendMessage (T2,win32con. Wm_settext,none, ' 761209 ') Win32gui. SendMessage (K1,win32con. Bm_click,none,none)
Hopefully this article will help you with Python programming.