给定父窗口的句柄,如何获取该窗口内按钮的句柄?
我win32api.sendMessage( )
用来将值传递给窗口。我想用来BM_CLICK
点击有问题的按钮。
import win32api
import win32gui
import win32con
#get handle of the window I want
hwnd=win32gui.FindWindow(0,"SOME TITLE")
#btnHnd= (NEED CODE HERE TO GET THE HANDLE OF THE BUTTON INSIDE hwnd)
win32api.SendMessage(btnHnd, win32con.BM_CLICK, 0, 0)