0


windows组件:另存为窗口设置

dialog = win32gui.FindWindow(“#32770”, “将打印输出另存为”)
if dialog:
pass
else:
time.sleep(1)
dialog = win32gui.FindWindow(“#32770”, “将打印输出另存为”)
a = win32gui.FindWindowEx(dialog, None, “DUIViewWndClassName”, None)
b = win32gui.FindWindowEx(a, None, “DirectUIHWND”, None)
c = win32gui.FindWindowEx(b, None, “FloatNotifySink”, None)
d = win32gui.FindWindowEx(c, None, “ComboBox”, None)
hwnd_filename = win32gui.FindWindowEx(d, None, “Edit”, None)
time.sleep(2)
win32gui.SendMessage(hwnd_filename, win32con.WM_SETTEXT, None, filename)
time.sleep(2)
hwnd_save = win32gui.FindWindowEx(dialog, None, “Button”, u’保存(&S)')
win32gui.PostMessage(hwnd_save, win32con.WM_KEYDOWN, win32con.VK_RETURN, 0)

filename为文件名

标签: windows python selenium

本文转载自: https://blog.csdn.net/m0_46304576/article/details/125409125
版权归原作者 m0_46304576 所有, 如有侵权,请联系我们删除。

“windows组件:另存为窗口设置”的评论:

还没有评论