How do I embed a Windows Explorer into my own Win32 C++ GUI, without
using MFC? Essentially, how do I satisfy the following API?
// OpenWindowsExplorer
// Fills the supplied HWND with the standard Windows Explorer file system
// interface. The user can use this just like she would use a standard Windows
// Explorer window, the only difference being this window is stuck inside my
// application's interface.
// Arguments:
// - hWnd ? The window through which the user will interact with the file system
// - path ? A path to the initial folder displayed in the window
// Returns:
// - Something* - Some kind of handle that I can use to manipulate the file view
Something* OpenWindowsExplorer( HWND hWnd, Path* path );
// CloseWindowsExplorer
// Cleans up resources allocated by OpenWindowsExplorer()
// Arguments:
// - handle - The handle from OpenWindowsExplorer( )
void CloseWindowsExplorer( Something* handle );
// SetWindowsExplorerCallback
// Sets a callback functor to handle events generated by the windows explorer.
// Arguments:
// - handle - The handle from OpenWindowsExplorer( )
// - callback - Pointer to a callback functor
void SetWindowsExplorerCallback( Something* handle, IWindowsExplorer* callback );
// IWindowsExplorer
struct IWindowsExplorer {
// onFolderChanging
// Called when the user changes folders in the Windows Explorer.
// Arguments:
// - from - Path to the current folder displayed
// - to - Path to the proposed, new folder
// Returns:
// Return true to allow the change, return false to disallow (cancel) the
// folder change.
bool onFolderChanging( Path* from, Path* to );
} |