How to start explorer with more than 1 file selected?

How to start explorer with more than 1 file selected?

Postby hua » Tue Mar 08, 2016 8:04 am

To start explorer with 1 file selected, I successfully use 'explorer /select, <cFile>'.

How to start it with multiple files selected instead? I read here we can use SHOpenFolderAndSelectItems but how to call it from FWH?

TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: How to start explorer with more than 1 file selected?

Postby Antonio Linares » Tue Mar 08, 2016 10:11 am

Hua,

This is compiling fine but the resulting EXE does nothing:

Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   SHOpenFolderAndSelectItems()

return nil

#pragma BEGINDUMP

#include <windows.h>
#include <shlobj.h>
#include <hbapi.h>

HB_FUNC( SHOPENFOLDERANDSELECTITEMS )
{
   //Directory to open
   ITEMIDLIST *dir = ILCreateFromPath( "C:\\" );

   //Items in directory to select
   ITEMIDLIST * item1 = ILCreateFromPath( "C:\\Program Files\\" );
   ITEMIDLIST * item2 = ILCreateFromPath( "C:\\Windows\\" );
   ITEMIDLIST * list[ 3 ];
   UINT count = 2;

   list[ 0 ] = item1;
   list[ 1 ] = item2;
   list[ 2 ] = 0;

   //Perform selection
   SHOpenFolderAndSelectItems( dir, count, ( PCUITEMID_CHILD_ARRAY ) list, 0 );

   //Free resources
   ILFree( dir );
   ILFree( item1 );
   ILFree( item2 );
}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42076
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 112 guests