+static int CALLBACK
+BrowseCallbackProc(HWND hwnd,UINT uMsg,LPARAM lp, LPARAM pData)
+ {
+ TCHAR szDir[MAX_PATH];
+
+ switch(uMsg)
+ {
+ case BFFM_INITIALIZED:
+ // We have put m_path into pData.
+ // TRUE -> passing char *, not dir id.
+ SendMessage(hwnd,BFFM_SETSELECTION,TRUE,pData);
+ break;
+
+ case BFFM_SELCHANGED:
+ // Set the status window to the currently selected path.
+ if (SHGetPathFromIDList((LPITEMIDLIST) lp ,szDir))
+ {
+ SendMessage(hwnd,BFFM_SETSTATUSTEXT,0,(LPARAM)szDir);
+ }
+ break;
+
+ default:
+ break;
+ }
+ return 0;
+ }
+
+