PB 5.10 PathRequester() does not show 'extensions'

Windows specific forum
infratec
Always Here
Always Here
Posts: 6883
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

PB 5.10 PathRequester() does not show 'extensions'

Post by infratec »

Hi,

I use PB 5.10 x86 on Win 7 x64.

Try this

Code: Select all

PathRequester("Test with directories like Test.001", "")
With directories like:
Test.001
Test.002

You will only see
Test
Test

And if you have directories like:
Test.infratec.001
Test.infratec.002

You will see
Test.infratec
Test.infratec

The last 'extension' is always not shown.

Bernd
jassing
Addict
Addict
Posts: 1775
Joined: Wed Feb 17, 2010 12:00 am

Re: PB 5.10 PathRequester() does not show 'extensions'

Post by jassing »

Do you have "hide extensions for known file types" enabled?
User avatar
skywalk
Addict
Addict
Posts: 4003
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: PB 5.10 PathRequester() does not show 'extensions'

Post by skywalk »

v5.11b1 works on both Windows 7 x86 & x64.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
infratec
Always Here
Always Here
Posts: 6883
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: PB 5.10 PathRequester() does not show 'extensions'

Post by infratec »

Hi,

here is the evidence:

Image

Win7 x64 with PB 5.10 x86

The left picture shows the PathRequester, the right is Windows Explorer.

Bernd
Fred
Administrator
Administrator
Posts: 16687
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB 5.10 PathRequester() does not show 'extensions'

Post by Fred »

Could you check in another software which also use a path requester ? I don't think there is a flag to set to show the extensions on folders (i didn't know there was even extensions for folders..)
infratec
Always Here
Always Here
Posts: 6883
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: PB 5.10 PathRequester() does not show 'extensions'

Post by infratec »

Hi Fred,

after thinking a bit I found one:

IrfanView Batch Processing, select output directory:
Image

(I deleted the other directory names)

Bernd
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: PB 5.10 PathRequester() does not show 'extensions'

Post by davido »

Hi infratec,

I tried you code snippet on my system: W7/64bit 5.10/64bit.

The requester shows all the extensions on directories.

Hiding known extensions, as I expected, makes no difference; they still show.

It is, perhaps, odd that others have not flagged the problem you are experiencing.
DE AA EB
infratec
Always Here
Always Here
Posts: 6883
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: PB 5.10 PathRequester() does not show 'extensions'

Post by infratec »

Hi davido,

the easy bugs are all fixed, only the tricky ones are left :wink:

How many peoble use such directory names?
Maybe only I.
But I use it to save my old software versions (for example).

Microsoft ways are always mystic :evil:

But it is trange that the IrfanView Requester shows the full names and the PB Requester not.

So something must be different.

Bernd
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: PB 5.10 PathRequester() does not show 'extensions'

Post by MachineCode »

I just tried this on Win 7, 64-bit, and both requesters show the ".000" part when C: was expanded:

Code: Select all

CreateDirectory_("C:\A-Test-Dir.000",0)
SHBrowseForFolder_(@dir.BROWSEINFO)
PathRequester("","C:\")
What does it show for you, infratec?
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4664
Joined: Sun Apr 12, 2009 6:27 am

Re: PB 5.10 PathRequester() does not show 'extensions'

Post by RASHAD »

Hi Berned :P
Try the next snippet with then without #BIF_BROWSEFILEJUNCTIONS
and see if there is any difference

Code: Select all

#BIF_BROWSEFILEJUNCTIONS = $00010000

Procedure BrowseCallbackProc(hwnd, msg, lParam, lData)
  Select msg
    Case #BFFM_INITIALIZED
      SendMessage_(hwnd, #BFFM_SETSELECTION, 1, lData)
  EndSelect
EndProcedure

Procedure.s BrowseForFolder( Path.s)
  Folder.s = Space(#MAX_PATH)
  bi.BROWSEINFO
  bi\ulFlags = #BIF_STATUSTEXT | #BIF_BROWSEINCLUDEFILES|#BIF_BROWSEFILEJUNCTIONS
  bi\lpfn = @BrowseCallbackProc()
  bi\lParam = @Path
  result.l = SHBrowseForFolder_(@bi)
  SHGetPathFromIDList_(result, @Folder)
  CoTaskMemFree_(result)
  ProcedureReturn Folder
EndProcedure

BrowseForFolder("c:\users")   ;Use your folder here

Egypt my love
infratec
Always Here
Always Here
Posts: 6883
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: PB 5.10 PathRequester() does not show 'extensions'

Post by infratec »

Hi MachineCode,

your example works, but... PB not
Image
infratec
Always Here
Always Here
Posts: 6883
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: PB 5.10 PathRequester() does not show 'extensions'

Post by infratec »

Hi MachineCode,

I was to fast.

Your example works fully. Also PB is showing the .000

Than I did some additional tests:

If I use

Code: Select all

SHBrowseForFolder_(@dir.BROWSEINFO)
PathRequester("","")
The PB Requester shows it correct too.

If I comment out the SHBrowseForFolder_() PB shows not the .xxx stuff :!:

It looks like that something is not correct initialized.
After the first call to SHBrowseForFolder_() it is initialized and the PB Requester works Ok.

Bernd
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: PB 5.10 PathRequester() does not show 'extensions'

Post by davido »

Hi infratec,

Pleased to see your problem is solved.

Incidentally Windows does not appear to treat the .001 as an extension, as attempting to rename the file highlights the whole lot.

This is a great Forum :!: :D
DE AA EB
infratec
Always Here
Always Here
Posts: 6883
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: PB 5.10 PathRequester() does not show 'extensions'

Post by infratec »

davido wrote:Pleased to see your problem is solved.
Nothing is solved :cry:

It's 'only' a workaround. :D

But you are right, a big thank you to all who are involved.

Bernd
User avatar
mk-soft
Always Here
Always Here
Posts: 5409
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB 5.10 PathRequester() does not show 'extensions'

Post by mk-soft »

No probleme her.

Win7 Pro X64, PB v5.10, v5.11

have you reinstall Purebasic?
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply