Show Properties-Window for multiple files/folders?

Just starting out? Need help? Post your questions and find answers here.
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Show Properties-Window for multiple files/folders?

Post by nco2k »

hi folks,

im using the following code to display the properties-window for a file/folder:

Code: Select all

Procedure ShowFileProperties(FileName$)
  Protected Result, CoInit, shell.SHELLEXECUTEINFO\cbSize = SizeOf(SHELLEXECUTEINFO)
  CoInit = CoInitializeEx_(0, #COINIT_APARTMENTTHREADED | #COINIT_DISABLE_OLE1DDE)
  If CoInit = CoInit & 1
    shell\fMask = #SEE_MASK_INVOKEIDLIST
    shell\lpVerb = @"properties"
    shell\lpFile = @FileName$
    shell\nShow = #SW_SHOW
    If ShellExecuteEx_(@shell)
      Result = #True
    EndIf
    CoUninitialize_()
  EndIf
  ProcedureReturn Result
EndProcedure
ShowFileProperties("C:\test.txt")
Delay(3000)
it works great but did anyone ever managed to make it work for multiple files/folders? :?

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
User avatar
spikey
Enthusiast
Enthusiast
Posts: 750
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: Show Properties-Window for multiple files/folders?

Post by spikey »

I don't think you can that way. ShellExecuteEx uses the verb table to determine what action should be performed. A collection of files doesn't work in an identical way. However Shell32.dll contains SHMultiFileProperties - have a look at http://msdn.microsoft.com/en-us/library ... s.85).aspx
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: Show Properties-Window for multiple files/folders?

Post by nco2k »

hi and thanks for your reply. i didnt even know that such a function existed. :o

now only thing left is to find out how to make it work in pb.. looks kinda complicated. :?

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Post Reply