diff options
Diffstat (limited to 'plugins/Non-IM Contact')
-rw-r--r-- | plugins/Non-IM Contact/src/contactinfo.cpp | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp index 8638bc5e48..265a2f1ae6 100644 --- a/plugins/Non-IM Contact/src/contactinfo.cpp +++ b/plugins/Non-IM Contact/src/contactinfo.cpp @@ -81,29 +81,27 @@ LRESULT CALLBACK ButtWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar int BrowseForFolder(HWND hwnd,char *szPath)
{
int result=0;
-
- if (SUCCEEDED(OleInitialize(NULL))) {
- LPMALLOC pMalloc;
- if (SUCCEEDED(CoGetMalloc(1,&pMalloc))) {
- ptrT tszPath( mir_a2t(szPath));
- BROWSEINFO bi={0};
- bi.hwndOwner = hwnd;
- bi.pszDisplayName = tszPath;
- bi.lpszTitle = TranslateT("Select Folder");
- bi.ulFlags = BIF_EDITBOX | BIF_RETURNONLYFSDIRS; // Use this combo instead of BIF_USENEWUI
- bi.lParam = (LPARAM)szPath;
-
- ITEMIDLIST *pidlResult = SHBrowseForFolder(&bi);
- if (pidlResult) {
- SHGetPathFromIDListA(pidlResult, szPath);
- mir_strcat(szPath,"\\");
- result = 1;
- }
- pMalloc->Free(pidlResult);
- pMalloc->Release();
+ LPMALLOC pMalloc;
+
+ if (SUCCEEDED(CoGetMalloc(1,&pMalloc))) {
+ ptrT tszPath( mir_a2t(szPath));
+ BROWSEINFO bi={0};
+ bi.hwndOwner = hwnd;
+ bi.pszDisplayName = tszPath;
+ bi.lpszTitle = TranslateT("Select Folder");
+ bi.ulFlags = BIF_EDITBOX | BIF_RETURNONLYFSDIRS; // Use this combo instead of BIF_USENEWUI
+ bi.lParam = (LPARAM)szPath;
+
+ ITEMIDLIST *pidlResult = SHBrowseForFolder(&bi);
+ if (pidlResult) {
+ SHGetPathFromIDListA(pidlResult, szPath);
+ mir_strcat(szPath,"\\");
+ result = 1;
}
- OleUninitialize();
+ pMalloc->Free(pidlResult);
+ pMalloc->Release();
}
+
return result;
}
|