Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

LotusScript calling API SHBrowseForFolder

Posted on 2000-03-03
Last Modified: 2013-12-18
In Notes 4.52, I tried using SHBrowseForFolder to select a folder/directory in my harddrive.

It works for returning the target directory.  However, I don't know how to pass the Initial directory, say c:\My Documents, to the SHBrowseForFolder window.

For anyone who can use LotusScript to perform the call back routine to pass a pre-defined directory into the SHBrowseForFolder, please help me to solve it?
Question by:keithchiu
  • 4
  • 3

Expert Comment

ID: 2579505
Check this site for more info:

What you want to do is set the starting directory that the user see at first...I dont think you need callback for that.  The pointer "browseinfo.pidlRoot" contains the starting directory, if its 0 or Null it will start at the desktop.


Author Comment

ID: 2579541
For browseinfo.pidlRoot, any function call so that I can pass a string "C:\My Documents" or other path string and get the folder id (long)?


Expert Comment

ID: 2581901
You can use:
SHGetFolderLocation or SHGetSpecialFolderLocation

An excellent example can be found here:

more detailed info can be found here:

This function will fill in the value in a special structure called ITEMIDLIST, then use it like the example - BI.pidlRoot = IDL.mkid.cb
You tell the function of the special folder through predefined CSIDL's, like "C:\My Documents" is 'CSIDL_PERSONAL', which u pass to the SHGetFOlderLocation.

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.


Author Comment

ID: 2586151
Your answer is encouraging.  However, it seems that SHGetFolderLocation or SHGetSpecialFolderLocation can only get special folders and not for folders created manually. (e.g, c:\A\B\C\)

Using pidlroot will only show the specific folder and its subfolders that User cannot click to uppper folder.  In Notes, is there any method for the SHBrowseForFolder to show the root as Desktop and a default highlighted directory is somewhere else (c:\A\B\C\)?

Accepted Solution

ghassan99 earned 200 total points
ID: 2586732
Did you check the ulFlag of the BrowserInfo Structure?  Those r cool stuff you can do to the dialog box.  Also in Win2000 the dialog box willl have a new look as I read.
I think to set any directory you have to use the lpfn from the same structure, but it has to use a callback function and they are not supported in Notes.
There is no function from Notes that you can use to do this.
Anyway I found an example in MS website about using the callback routine in C


Expert Comment

ID: 2656371
Any news?


Author Comment

ID: 2659280
When I knew that it does not support the callback function, I gave up and the application simply has no default folder.  Anyway, thank you very much.  Your answer saved me a lot of time.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question