给你个对象:
forward
global type nca_folderbrowse from nonvisualobject
end type
type shitemid from structure within nca_folderbrowse
end type
type itemidlist from structure within nca_folderbrowse
end type
type browseinfo from structure within nca_folderbrowse
end type
end forward
type shitemid from structure
unsignedint cb
character abid
end type
type itemidlist from structure
shitemid mkid
end type
type browseinfo from structure
unsignedlong howner
unsignedlong pidlroot
string pszdisplayname
string lpsztitle
unsignedint ulflags
unsignedlong lpfn
long lparam
integer iimage
end type
global type nca_folderbrowse from nonvisualobject autoinstantiate
end type
type prototypes
Protected:
Function unsignedlong SHGetPathFromIDListA( unsignedlong pidl, ref string pszPath) Library 'shell32'
Function unsignedlong SHBrowseForFolderA( browseinfo lpbrowseinfo ) Library 'shell32'
Subroutine CoTaskMemFree(ulong idlist) Library 'ole32'
end prototypes
type variables
Protected:
unsignedLong BIF_RETURNONLYFSDIRS = 1
end variables
forward prototypes
public function string browseforfolder (window awi_parent, string as_caption)
public function string browseforfolder (window awi_parent, string as_caption)
end prototypes
public function string browseforfolder (window awi_parent, string as_caption);
/********************************************************************
BrowseForFolder
<DESC> Open the browse for folder dialog and return the
selected directory.</DESC>
<RETURN> String: Folder Selected.</RETURN>
<ACCESS> Public
<ARGS> awi_Parent: Parent Window.
as_Caption: Caption to display on dialog.</ARGS>
Date Ref Author Comments
07/16/98 1 Ken Howe First Version
08/24/98 1.1 Matthew Royle Changed to work with PB5.0
06/03/99 1.2 Ken Howe Added CoTaskMemFree, based on a
Discussion on the PB News group and
also this ise used in many VB examples.
********************************************************************/
// This is a code example:
/*
nva_folderbrowse lnca_bff
String ls_A