Hlavní Stránka | Software | Podpora | Prodej | Kontakt | O Nás | Zprávy | Odkazy | Španělsky Espańol | Anglicky English

Třída CSHBrowseFolder
zjednodušte výběr adresáře

Stažení Stažení

 

Charakteristika
1 extrémně jednoduché a malé
2 model třídy i funkce
3 implementovaný callback
4 zdarma s plnně otevřeným kódem

Requirements: Windows 32bit, Visual C++ 5.0 (SP3 recommended)

Nástroj pro výběr adresáře poskytuje jednoduchý způsob výběru adresáře v aplikacích vyvíjených ve Visual C++. Objektová a na funkci založená verze je k dispozici, vše s podporou callback.

Tento nástroj je zdarma s plnně otevřeným kódem.

To set up you application or library to work with this class:
- Copy SHBrowseFolder.h and SHBrowseFolder.cpp files to your project directory
- Include SHBrowseFolder.h and SHBrowseFolder.cpp files in your project
- In stdafx.h or similar file, include shlobj.h file
- In stdafx.h or in your source file, include SHBrowseFolder.h file
- Call the selector using the syntax:
CSHBrowseFolder(m_hWnd).DoModal(pszPath, pszTitle);

where:
- m_hWnd is parent window handle and may be NULL
- pszPath sends and receives full path selected
- pszTitle will display the title of the tree

DoModal method returns 'pidle' or NULL if selection was canceled.
See SHBrowseForFolder and SHGetPathFromIDList API functions and BROWSEINFO structure for more information.
See the example dialog methods OnSimple and OnAction to see the implementation.

Methods:
CSHBrowseFolder::CSHBrowseFolder(HWND hwndOwner, UINT uiFlags =/* BIF_RETURNONLYFSDIRS*/)
- hwndOwner is a handle, CWnd-derived class may use m_hWnd member or *this (calls conversion to HWND)
- uiFlags default parameter may be ORed with BIF_STATUSTEXT to display current selection or any other text

LPITEMIDLIST CSHBrowseFolder::DoModal(char *pszPath, const char *pszTitle, char *pszDisplayName/* = 0*/)
- pszPath sends and receives the full path of the selection or is NULL
- pszTitle may point to text or CString using resource ID
- pszDisplayName receives name of the item selected or is NULL

int WINAPI CSHBrowseFolder::BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
- callback procedure that handles only initialization to setup default folder and selection change to update the status
- may be extended to enable or disable OK button when item selection changes, etc.

There's abother one implemetaion in this project. See files BrowseFolder.h and BrowseFolder.cpp, and the function:
LPITEMIDLIST BrowseFolder(HWND hwndOwner, char *pszPath, const char *pszTitle, UINT uiFlags = BIF_RETURNONLYFSDIRS, char *pszDisplayName = 0);
- arguments description is the same, only include these files instead of SHBrowseFolder.h and SHBrowseFolder.cpp
- call the function similary like in commented versions of OnSimple and OnAction methods


Stažení
English
Otevřený Kód
Zdarma

© 2004 Jakub Sika. Všechna práva vyhrazena.
Poslední úprava: 14.10.2005 15:50