Page 1 of 1

Query about FileSelectFile

Posted: 14 May 2022, 15:54
by PuzzledGreatly
I've noticed that when the filename is set for fileselectfile and it is long, eg "Fly to the cherry tree" the whole name is not shown in the dialogue edit field. The field is highlighted and pressing left will show the entire name but why is this necessary? Why isn't the entire file name shown immediately? Thanks.

Re: Query about FileSelectFile

Posted: 15 May 2022, 03:48
by hd0202
Sorry, I cannot answer your question. My WIN8.1 system also reacts with shorted file names, I think it is a windows problem.
But I found a workaround, that simulates a user action:

Code: Select all

File := "Fly to the cherry tree"
selection := "select the file you want"

settimer, timer, 10

FileSelectFile, AusgabeVar,, % file, % selection
msgbox, % ausgabevar " selected"
exitapp

timer:
ifwinactive, % Selection
{
settimer, timer, off
controlsend, ComboBox2, {down 2}{enter}
}
return
Hubert

Re: Query about FileSelectFile

Posted: 16 May 2022, 08:06
by PuzzledGreatly
Thanks for the reply and suggestion. I tried it but it didn't result in the whole file name being shown on my machine.

Re: Query about FileSelectFile

Posted: 17 May 2022, 04:03
by hd0202
That can occur depending on the given filters. You must have at least one filter other than "All Data (*.*)", which is default.

You can test it manually and it will always be okay:
- select "All Data (*.*)" -> the file selection is changed to all files
- select the other filter, e.g. (*.txt) -> the file selection is changed again, this time to the files according to the filter
and then the full filename is shown

And the problem is: your code must be executed between showing the selection screen and waiting for the user to answer (therefore I use the timer to do it in a separate thread) !

I think, there is another problem: the second selection - away from "All Data (*.*)" - is only accepted when all files are shown, which can take a long time with many files. Perhaps it can be reached by a second timer started from within the first timer, but I didn't test it.

A test via Dllcall and the system API delivered a shortened name too !

Hubert