Use cRegistry.pkg //declare C structure struct_browseinfo //as documented in MSDN under Windows Shell API Type tAKEBrowseInfo Field tAKEBrowseInfo.hWndOwner as Handle Field tAKEBrowseInfo.pIDLRoot as Pointer Field tAKEBrowseInfo.pszDisplayName as Pointer Field tAKEBrowseInfo.lpszTitle as Pointer Field tAKEBrowseInfo.ulFlags as dWord Field tAKEBrowseInfo.lpfnCallback as Pointer Field tAKEBrowseInfo.lParam as dWord Field tAKEBrowseInfo.iImage as dWord End_Type // tBrowseInfo External_Function AKE_SHBrowseForFolder "SHBrowseForFolder" shell32.dll ; pointer lpdw Returns dWord External_Function AKE_SHGetPathFromIDList "SHGetPathFromIDList" shell32.dll ; pointer pidList pointer lpBuffer Returns dWord // returns folder name if a folder was selected, otherwise returns "" Function AKE_GetSelectFolder Global String sDialogTitle Returns String String sFolder sBrowseInfo sTitle pointer lpItemIdList lpsFolder lpsBrowseInfo lpsTitle Integer iFolderSelected iObj // fill string variable with null characters ZeroType tAKEBrowseInfo To sBrowseInfo If (sDialogTitle<>"") Begin Move (toAnsi(sDialogTitle)) To sTitle GetAddress Of sTitle To lpsTitle Put lpsTitle To sBrowseInfo At tAKEBrowseInfo.lpszTitle End Put (window_handle(focus(desktop))) To sBrowseInfo At tAKEBrowseInfo.hWndOwner GetAddress Of sBrowseInfo To lpsBrowseInfo // null 128 chars into var (make space) Move (Repeat(Character(0), 128)) To sFolder GetAddress Of sFolder To lpsFolder // select folder Move (AKE_SHBrowseForFolder(lpsBrowseInfo)) To lpItemIdList // get selected folder name Move (AKE_SHGetPathFromIDList(lpItemIdList, lpsFolder)) To iFolderSelected If (iFolderSelected<>0) Function_Return (CString(sFolder)) Else Function_Return "" End_Function // GetSelectFolder Class cDirFormReg Is A cRegistry Function RegValue String sValue String sStandard Returns String String sRegKey sOuttxt sModule Boolean bopened Move sStandard To sOutTxt Get Module_Name To sModule Move ("Software\"+sModule) To sRegKey Set phRootKey To HKEY_CURRENT_USER Get OpenKey sRegKey To bOpened If bOpened Begin If (ValueExists(Self, sValue)) Begin Get ReadString sValue To sOutTxt End Send CloseKey End Function_Return sOutTxt End_Function Procedure Set RegValue String sValue String sTxt String sRegKey sModule Boolean bCreateFejl Get Module_Name To sModule Move ("Software\"+sModule) To sRegKey Set phRootKey To HKEY_CURRENT_USER Get CreateKey sRegKey To bCreateFejl If Not bCreateFejl Begin Send WriteString sValue sTxt Send CloseKey End End_Procedure End_Class { OverrideProperty=Form_DataType InitialValue=ascii_window } { OverrideProperty=Form_DataType DesignTime=False } { OverrideProperty=Prompt_Button_Mode InitialValue=pb_PromptOn } { OverrideProperty=Prompt_Button_Mode DesignTime=False } Class DirForm Is A Form Procedure Construct_object Forward Send construct_object Property String RegistrationValueName public "" { InitialValue="V‘lg mappe" } Property String Dialog_caption Public "V‘lg mappe" Set prompt_button_mode to pb_PromptON Object oReg is a cDirFormReg End_Object End_Procedure Procedure Prompt String sDir sTitle sRegValue Get Dialog_caption To sTitle Get RegistrationValueName To sRegValue Move (AKE_GetSelectFolder(sTitle)) To sDir If (sDir <> "") Begin Set Value To sDir If (sRegValue <> "") Begin Set RegValue Of oReg sRegValue To sDir End End End_Procedure Procedure Activating String sRegValue sDir Integer iFail Forward Get msg_Activating to iFail Get RegistrationValueName To sRegValue If (sRegValue <> "") Begin Get RegValue Of oReg sRegValue "" To sDir Set Value To sDir End Procedure_Return iFail End_Procedure End_Class