kapiaba Posted July 2, 2015 Report Share Posted July 2, 2015 // Procurar uma pasta no xHarbour #Include "FiveWin.ch" #Include "\xHarbour\contrib\what32\include\commdlg.ch" // For BIF_USENEWUI FUNCTION Main() LOCAL cPath cPath := ShBrowseForFolder(NIL , "This is text in the"+Chr(13)+"header of the file", BIF_USENEWUI ) RETURN cPath #pragma BEGINDUMP #include "windows.h" /* in bcc55/include folder */ #include "shlobj.h" /* in bcc55/include folder */ HB_FUNC( SHBROWSEFORFOLDER ) { HWND hwnd = ISNIL (1) ? GetActiveWindow() : (HWND) hb_parnl(1); BROWSEINFO BrowseInfo; char *lpBuffer = (char*) hb_xgrab( MAX_PATH + 1 ); LPITEMIDLIST pidlBrowse; SHGetSpecialFolderLocation(hwnd, ISNIL(4) ? CSIDL_DRIVES : hb_parni(4), &pidlBrowse) ; BrowseInfo.hwndOwner = hwnd; BrowseInfo.pidlRoot = pidlBrowse; BrowseInfo.pszDisplayName = lpBuffer; BrowseInfo.lpszTitle = ISNIL (2) ? "Select a Folder" : hb_parcx(2); BrowseInfo.ulFlags = hb_parni(3); BrowseInfo.lpfn = NULL; BrowseInfo.lParam = 1; BrowseInfo.iImage = 0; pidlBrowse = SHBrowseForFolder(&BrowseInfo); if ( pidlBrowse ) { SHGetPathFromIDList(pidlBrowse,lpBuffer); hb_retc( lpBuffer ); } else { hb_retc( "" ); } hb_xfree( lpBuffer); } #pragma ENDDUMP Quote Link to comment Share on other sites More sharing options...
Euclidao Posted July 2, 2015 Report Share Posted July 2, 2015 Legal, Kapi... e qual é a vantagem disso em relação ao cGetDir() ? []'s, Euclides kapiaba 1 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted July 2, 2015 Author Report Share Posted July 2, 2015 Ter mais uma opção Euclides. Quote Link to comment Share on other sites More sharing options...
Euclidao Posted July 2, 2015 Report Share Posted July 2, 2015 Pois é... Eu prefiro o que o Sr. postou em 16 dezembro 2014. Faz o DEFINE: #define BIF_USENEWUI 0x0050 e aí funciona com o Harbour também T+ Euclides kapiaba 1 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted July 2, 2015 Author Report Share Posted July 2, 2015 Pois é... Eu prefiro o que o Sr. postou em 16 dezembro 2014. Faz o DEFINE: #define BIF_USENEWUI 0x0050 e aí funciona com o Harbour também T+ Euclides Não sei Euclides, não uso harbour ainda. abs. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.