` Pick a directory using 32 bit API calls (Jeff Berlinghoff ) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Pick a directory using 32 bit API calls
1998-01-09 -- Jeff Berlinghoff
 
CW4 has this built in, but I needed to be able to do this in CW2. It was easier than I expected. Global Embed, After Global Includes: BROWSEINFO GROUP,TYPE hWndOwner LONG pIDLRoot LONG lpszDisplayName LONG lpszTitle LONG ulFlags LONG lpfnCallBack LONG iImage LONG END Global Embed, Inside Global Map: MODULE('Shell32') SHBrowseForFolder(*BrowseInfo),LONG,RAW,PASCAL SHGetPathFromIDList(Long,*CSTRING),LONG,RAW,PASCAL CoTaskMemFree(*LONG),RAW,PASCAL END Procedure, Embed, Data BI LIKE(BrowseInfo) cTitle CSTRING(30) cPath CSTRING(251) In the Code (BE SURE YOU HAVE A WINDOW OPEN!) cTitle = 'List Title Message' cPath = '<0>{250}' BI.hWndOwner = 0{prop:Handle} BI.lpszTitle = ADDRESS(cTitle) BI.ulFlags = 1 !only show directories! lpIDList# = SHBrowseForFolder(BI) IF lpIDList# Result# = SHGetPathFromIDList(lpIDList#, cPath) COTaskMemFree(lpIDList#) MESSAGE(cPath, 'You Chose') END


Today is April 25, 2024, 6:02 pm
This article has been viewed 35112 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: