+ if((wParam&0xffff) == 0x9999) {
+ BROWSEINFOA browse;
+ memset(&browse, 0, sizeof(browse));
+ browse.ulFlags = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_USENEWUI;// | BIF_RETURNONLYFSDIRS; //BIF_VALIDATE
+ browse.pszDisplayName = (CHAR*)malloc(MAX_PATH);
+ memset(browse.pszDisplayName, 0, MAX_PATH);
+ browse.lpszTitle = "Select installation directory";
+ /*browse.pidlRoot = (ITEMIDLIST*)malloc(sizeof(ITEMIDLIST)*200);
+ memset((void*)browse.pidlRoot, 0, sizeof(ITEMIDLIST)*200);*/
+ printf("Start browsing %s\n", browse.pszDisplayName);
+ //SHGetDesktopFolder
+ //ParseDisplayName(install_path,0,&browse.pidlRoot,0,0);
+ //SHParseDisplayName(install_path,0,&browse.pidlRoot,0,0);
+ //SHBrowseForFolderA(&browse);
+ browse.pidlRoot = SHBrowseForFolder(&browse);
+ printf("Browsing returns %s / %08x\n", browse.pszDisplayName, browse.pidlRoot);
+ if(browse.pszDisplayName) {
+ if(SHGetPathFromIDList(browse.pidlRoot, browse.pszDisplayName)) {
+ printf("Path is %s\n", browse.pszDisplayName);
+ install_path = browse.pszDisplayName;
+ }
+ }
+ SendMessage(data.edit, WM_SETTEXT, 0, (LPARAM)install_path);
+ return 0;
+ } else if((wParam&0xffff) == 0xabcd) {
+ data.ok = 1;
+ DestroyWindow(wnd_params);
+ return 0;
+ } else if((wParam&0xffff) == 0x1234) {
+ SendMessage(data.edit, WM_GETTEXT, sizeof(pathBuf), (LPARAM)&(pathBuf[0]));
+ if(pathBuf[0]) {
+ install_path = pathBuf;
+ printf("Path edited: now \"%s\"\n", install_path);
+ }
+ return 0;
+ }
+ return DefWindowProc(hwnd, message, wParam, lParam);