BrowseForFolder() doesn't (yet) support this style of calling. And there aparently was a bug in the code. Could you try to replace the BrowseForFolder in FileOp.pm with the following code:
and then usesub 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; }
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 |
In reply to Re^3: Win32::FileOp window positioning?
by Jenda
in thread Win32::FileOp window positioning?
by spikey_wan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |