<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>I have changed the third parameter, but it still did not work on Win8.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span><span style="font-style: italic;">print "abc"<br>hWindow = win32gui.FindWindow('MsiDialogCloseClass', None)<br>if hWindow <> 0:<br> print hWindow<br> hButton = win32gui.FindWindowEx(hWindow, 0, 'Button', '&Next >')<br> if hButton <> 0:<br> print
hButton<br> win32gui.SendMessage(win32gui.GetParent(hButton), win32con.WM_COMMAND, (win32con.BN_CLICKED << 16) | win32gui.GetDlgCtrlID(hButton), hButton)<br> else:<br> print "ghi"<br>else:<br> print "def"</span><br><br></span></div><div>Output:</div><div>abc</div><div>131870</div><div>131888</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">(The tested dialog used is the installation file for JDK 1.6.0_37
jdk-6u37-windows-i586.exe from
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u37-oth-JPR.)</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight:bold;">发件人:</span></b> Tim Roberts <timr@probo.com><br> <b><span style="font-weight: bold;">收件人:</span></b> Python-Win32 List <python-win32@python.org> <br> <b><span style="font-weight: bold;">发送日期:</span></b> 2013年1月4日, 星期五, 1:55 上午<br> <b><span style="font-weight: bold;">主题:</span></b> Re: [python-win32] 回复: The program passes on
Win7 but fails on Win8<br> </font> </div> <br>震坤 蔡 wrote:<br>> Thanks for your reply.<br>> For the program I have written:<br>> print "abc"<br>> hWindow = win32gui.FindWindow('MsiDialogCloseClass', None)<br>> if hWindow <> 0:<br>> print hWindow<br>> hButton = win32gui.FindWindowEx(hWindow, 0, 'Button', '&Next >')<br>> if hButton <> 0:<br>> print hButton<br>> win32gui.SendMessage(win32gui.GetParent(hButton), win32con.WM_COMMAND, win32con.BN_CLICKED, hButton)<br>> else:<br>> print "ghi"<br>> else:<br>> print "def"<br>> The hWindow and hButton can both be printed out and they are both not 0.<br>> The application does not crash but the Next button click action is not<br>> triggered.<br><br>No, of course not, because the SendMessage
call is still wrong. Did you<br>even read my reply? The third parameter is wrong.<br><br>-- <br>Tim Roberts, <a ymailto="mailto:timr@probo.com" href="mailto:timr@probo.com">timr@probo.com</a><br>Providenza & Boekelheide, Inc.<br><br>_______________________________________________<br>python-win32 mailing list<br><a ymailto="mailto:python-win32@python.org" href="mailto:python-win32@python.org">python-win32@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/python-win32" target="_blank">http://mail.python.org/mailman/listinfo/python-win32</a><br><br><br> </div> </div> </div></body></html>