Core Function FolderSelectDialog

From Sputnik Wiki
Jump to: navigation, search
FolderSelectDialog ( <text>, <dir>, <flag>, <init dir> )

Contents

Description

Initiates a Browse For Folder Dialog.

Parameters

title

Text greeting in dialog.

dir

Root directory of GUI file tree. Use "" for Desktop to be root.

flag

Optional;

1 = Show Create Folder Button -- Default FALSE

init dir

Initial/start directory that will be selected if exist.

Choices are:

applicationdata
commonapplicationdata
commonprogramfiles
cookies
desktop
desktopdirectory
favorites
history
internetcache
localapplicationdata
mycomputer
mydocuments
mymusic
mypictures
personal
programfiles
programs
recent
sendto
startmenu
startup
system
templates

Note - If you enter something invalid it will default to desktop.

Return Value

Success: Returns full path of the folder chosen.

Failure: Returns a blank string.


Remarks

The root dir will be chosen if the inital dir (if given) does not exist.

A nonexistent root dir will also cause the Desktop folder to be root.

The "Create Folder Button" option may require Windows XP with IE6 in order to work.

Special Windows folders (such as "My Documents") can be set at root by using the right CLSID detailed in the Appendix.

Example

$var = FolderSelectDialog("Choose a folder.", "");
 
If (!$var)
{
    MsgBox("No Folder chosen");
}
Else
{
    MsgBox("You chose the folder $var");
}


$var = FolderSelectDialog("Choose a folder.", "startmenu", 1);
 
If (!$var)
{
    MsgBox("No Folder chosen");
}
Else
{
    MsgBox("You chose the folder $var");
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox