Python Forum

Full Version: Set Text in Open Dialog Box
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,

I am trying send text to the File Name box and then click the button open. It is the textbox from the open dialog box you get when you click browse or open from a webpage. The below is what I have so far. When running it finds the words File name: but it does not send the text Location to the field. How can I go about and fix this issue? Thanks.

import win32gui
WM_SETTEXT = 0x0c
win2find = input('File Name:')
whnd = win32gui.FindWindowEx(None, None, None, win2find)
if not (whnd == 0):
ta = win32gui.SendMessage(whnd, WM_SETTEXT, 1, "Location")
print('FOUND!')
[attachment=1074]