Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set Text in Open Dialog Box
#1
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!')
   
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Hard disk structure like a file selection dialog malonn 2 790 Aug-09-2023, 09:14 PM
Last Post: malonn
  Start print a text after open an async task via button Nietzsche 0 699 May-15-2023, 06:52 AM
Last Post: Nietzsche
  [S0LVED] [Tkinter] Center dialog? Winfried 8 4,195 Mar-01-2022, 07:17 PM
Last Post: Winfried
  how to view all installed software in a dialog Tyrel 6 2,120 Oct-09-2021, 08:11 PM
Last Post: Tyrel
  Open and read multiple text files and match words kozaizsvemira 3 6,737 Jul-07-2021, 11:27 AM
Last Post: Larz60+
  Subprocesses not opening File Select Dialog teut 2 2,401 Feb-22-2021, 08:07 PM
Last Post: teut
  How to write a code to open and read text file by clicking on the "text file" kavindu 4 4,129 Jul-06-2018, 06:55 PM
Last Post: buran
  Need help to open PDF file and Export to text file ratna_ain 3 7,054 Oct-10-2017, 01:44 AM
Last Post: ratna_ain

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020