function MySHDPath5(mindex:longint):string; var BrowseInfo: TBrowseInfo; DisplayName: array[0..MAX_PATH] of char; idBrowse,idl : PItemIDList; tmp : PChar; i:longint; begin Result:='; try Getmem(tmp, 255); i:=sizeof(longint); SHGetSpecialFolderLocation(application.Handle,mindex, idl); with BrowseInfo do begin hWndOwner:=application.Handle; pidlRoot:=idl; pszDisplayName:=DisplayName; lpszTitle:='目录选择'; ulFlags:=BIF_STATUSTEXT+80; lpfn:=@BrowseCallbackProc(application.Handle, BFFM_INITIALIZED,1,i);//编译错误 lParam:=0; end; idBrowse:=SHBrowseForFolder(BrowseInfo); if assigned(idBrowse) then Begin SHGetPathFromIDList(idBrowse,tmp); Result :=strpas(tmp); end; finally Freemem(tmp); end; end; function BrowseCallbackProc(hwnd:HWND;uMsg:UINT;lp:LPARAM;pData:LPARAM ):longint; begin case uMsg of BFFM_INITIALIZED: begin//1 SendMessage(hwnd,BFFM_SETSELECTION,lp,LPARAM(shroot));