Tim Roberts wrote: > 震坤 蔡 wrote: >> I wrote the following program. It could not pass on Win8, but it can >> pass on Win7. >> It will try to simulate the action to click the Next button on an >> existing dialog (I use JDK installation dialog). >> I believe the issue comes from the statement >> 'win32gui.SendMessage(win32gui.GetParent(hButton), >> win32con.WM_COMMAND, win32con.BN_CLICKED, hButton)'. > Your call is incorrect. The WPARAM for BN_CLICKED is supposed to have > the button's control ID in the low word, and the notification code in > the high word. So, you should have: > > win32gui.SendMessage( win32gui.GetParent(hButton, win32con.WM_COMMAND, > (win32con.BN_CLICKED << 16) | win32gui.GetDlgCtrlID(hButton), > hButton );
(Whoops, there's a missing parenthesis and an extra semicolon there:) win32gui.SendMessage( win32gui.GetParent(hButton), win32con.WM_COMMAND, (win32con.BN_CLICKED << 16) | win32gui.GetDlgCtrlID(hButton), hButton ) -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32