2002/05/18:

An overview of the Program Preferences dialog. It will be possible in the future release to overwrite default environment PATH variable and therefore running the compiler or needed binaries without anything added in Autoexec.bat.

Program preferences

A little piece of OLE and its possible to use the "Browse for folders" dialog, here in local (Gallic :) language.

Snip from winui.cpp:

/********************************************************************
*        Class:        CShellDlg.
*
*        Purpose:        
*
*        Revisions:        
*
********************************************************************/

CShellDlg::CShellDlg(){
        
// Get shell task allocator.
        
if(SHGetMalloc(&pMalloc) == (HRESULT) E_FAIL)
                
pMalloc = NULL;
}

CShellDlg::~CShellDlg(){
        
// Decrements the reference count.
        
if (pMalloc)
                
pMalloc->Release();
}

bool CShellDlg::BrowseForFolder(CWindow * pWindow, LPSTR pszDisplayName, 
                
LPCSTR lpszTitle, UINT ulFlags, BFFCALLBACK lpfn, LPARAM lParam, int iImage){

        
// Initialize output buffer.
        
*pszDisplayName = '\0';
        
// BROWSEINFO.
        
if (!pWindow)
                
bi.hwndOwner = 0;
        
else
                
bi.hwndOwner = pWindow->_hWnd;
        
bi.pidlRoot = NULL;
        
bi.pszDisplayName = pszDisplayName;
        
bi.lpszTitle = lpszTitle;
        
bi.ulFlags = ulFlags;
        
bi.lpfn = lpfn;
        
bi.lParam = lParam;
        
bi.iImage = iImage;

        
LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
        
if(!pidl)
                
return false;
        
        
if(!SHGetPathFromIDList(pidl, pszDisplayName))
                
return false;

        
pMalloc->Free(pidl);
return true;
}

Copyright (C) 2001  Manu B.
See Visual-MinGW licensing terms.

Powered by

Powered by SourceForge.net