sub BrowseForFolder {
undef $Win32::FileOp::Error;
my $lpszTitle = shift() || "\0";
my $nFolder = shift() || 0;
my $ulFlags= (shift() || 0) | 0x0000;
my $hwndOwner = (defined $_[0] ? shift() : GetWindowHandle());
my ($pidlRoot, $pszDisplayName, $lpfn, $lParam, $iImage, $pszPath)
= ("\0"x260, "\0"x260, 0, 0, 0, "\0"x260 );
$nFolder = CSIDL_DRIVES() unless defined $nFolder;
$Win32::FileOp::SHGetSpecialFolderLocation->Call($hwndOwner, $nFold
+er, $pidlRoot)
and return undef;
$pidlRoot = hex unpack 'H*',(join'', reverse split//, $pidlRoot);
my $browseinfo = pack 'LLppILLI',
($hwndOwner, $pidlRoot, $pszDisplayName, $lpszTitle,
$ulFlags, $lpfn, $lParam, $iImage);
my $bool = $Win32::FileOp::SHGetPathFromIDList->Call(
$Win32::FileOp::SHBrowseForFolder->Call($browseinfo),
$pszPath
);
$pszPath =~ s/\0.*$//s;
$bool ? $pszPath : undef;
}
and then use
my $dir1 = BrowseForFolder("with handle", undef, undef, $windowid);
I have a few more changes pending to be released, hopefully I'll have some spare time to do that sometime soon.
HTH, Jenda
We'd like to help you learn to help yourself
Look around you, all you see are sympathetic eyes
Stroll around the grounds until you feel at home
-- P. Simon in Mrs. Robinson |
|