Changeset 1556 for trunk/src/comdlg32/filedlgbrowser.cpp
- Timestamp:
- Nov 2, 1999, 9:37:43 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comdlg32/filedlgbrowser.cpp
r1548 r1556 1 /* $Id: filedlgbrowser.cpp,v 1.1 1999-11-02 19:09:42 sandervl Exp $ */2 1 /* 3 * Implementation of IShellBrowser for the File Open common dialog (990815)2 * Implementation of IShellBrowser for the File Open common dialog 4 3 * 5 4 * 6 5 */ 6 7 #include <stdio.h> 8 #ifdef __WIN32OS2__ 7 9 // ><DJR 17.05.99 Force to use C-interfaces for now to prevent CALLBACK definition compiler error 8 10 #define CINTERFACE 1 9 10 #include <stdio.h> 11 #include <os2win.h> 11 12 #include "unknwn.h" 12 #include <os2win.h>13 13 #include "filedlgbrowser.h" 14 #else 15 #include "unknwn.h" 16 #include "filedlgbrowser.h" 17 #include "winuser.h" 18 #endif 14 19 #include "heap.h" 15 #include "commctrl.h"16 20 #include "wine/obj_dataobject.h" 17 21 #include "debugtools.h" … … 77 81 78 82 HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IShellView *ppshv); 83 #if 0 79 84 LPITEMIDLIST GetSelectedPidl(IShellView *ppshv); 85 #endif 80 86 81 87 /************************************************************************** … … 116 122 sb->lpVtbl2 = &IShellBrowserImpl_ICommDlgBrowser_Vtbl; 117 123 118 SHGetSpecialFolderLocation(hwndOwner,124 COMDLG32_SHGetSpecialFolderLocation(hwndOwner, 119 125 CSIDL_DESKTOP, 120 126 &fodInfos->ShellInfos.pidlAbsCurrent); … … 194 200 if (!--(This->ref)) 195 201 { 196 SHFree(This);202 COMDLG32_SHFree(This); 197 203 return 0; 198 204 } … … 287 293 } 288 294 /* create an absolute pidl */ 289 pidlTmp = ILCombine(fodInfos->ShellInfos.pidlAbsCurrent,295 pidlTmp = COMDLG32_PIDL_ILCombine(fodInfos->ShellInfos.pidlAbsCurrent, 290 296 (LPITEMIDLIST)pidl); 291 297 … … 302 308 { 303 309 /* An absolute pidl (relative from the desktop) */ 304 pidlTmp = ILClone((LPITEMIDLIST)pidl);310 pidlTmp = COMDLG32_PIDL_ILClone((LPITEMIDLIST)pidl); 305 311 psfTmp = GetShellFolderFromPidl(pidlTmp); 306 312 } 307 313 314 308 315 /* Retrieve the IShellFolder interface of the pidl specified folder */ 309 316 if(!psfTmp) 310 317 return E_FAIL; 318 319 /* If the pidl to browse to is equal to the actual pidl ... 320 do nothing and pretend you did it*/ 321 if(COMDLG32_PIDL_ILIsEqual(pidlTmp,fodInfos->ShellInfos.pidlAbsCurrent)) 322 { 323 IShellFolder_Release(psfTmp); 324 COMDLG32_SHFree(pidlTmp); 325 return NOERROR; 326 } 311 327 312 328 /* Release the current fodInfos->Shell.FOIShellFolder and update its value */ … … 349 365 350 366 /* Release old pidlAbsCurrent memory and update its value */ 351 SHFree((LPVOID)fodInfos->ShellInfos.pidlAbsCurrent);367 COMDLG32_SHFree((LPVOID)fodInfos->ShellInfos.pidlAbsCurrent); 352 368 fodInfos->ShellInfos.pidlAbsCurrent = pidlTmp; 353 369 … … 626 642 HRESULT hRes; 627 643 628 /* Selected item is a directory so browse to it */629 630 644 ULONG ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER; 631 645 IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr); … … 634 648 /* Tell the dialog that the user selected a file */ 635 649 else 650 { 636 651 hRes = FILEDLG95_OnOpen(This->hwndOwner); 652 } 637 653 638 654 /* Free memory used by pidl */ 639 SHFree((LPVOID)pidl);655 COMDLG32_SHFree((LPVOID)pidl); 640 656 641 657 return hRes; … … 662 678 break; 663 679 case CDBOSC_KILLFOCUS: 680 { 681 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); 682 if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) 683 SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save"); 684 } 664 685 break; 665 686 case CDBOSC_SELCHANGE: … … 705 726 706 727 if (SUCCEEDED(IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_FORPARSING, &str))) 707 { if (SUCCEEDED(StrRetTo StrNW(szPathW, MAX_PATH, &str, pidl)))728 { if (SUCCEEDED(StrRetToBufW(&str, pidl,szPathW, MAX_PATH))) 708 729 { 709 if (PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))730 if (COMDLG32_PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter)) 710 731 return S_OK; 711 732 } … … 721 742 { 722 743 LPITEMIDLIST pidl; 723 744 FileOpenDlgInfos *fodInfos; 724 745 _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface); 725 746 747 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); 726 748 TRACE("(%p)\n", This); 727 749 … … 731 753 char lpstrFileName[MAX_PATH]; 732 754 733 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);734 735 755 ULONG ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER; 736 756 IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr); … … 739 759 if(SUCCEEDED(hRes = GetName(fodInfos->Shell.FOIShellFolder,pidl,SHGDN_NORMAL,lpstrFileName))) 740 760 SetWindowTextA(fodInfos->DlgInfos.hwndFileName,lpstrFileName); 761 if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) 762 SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save"); 741 763 } 742 743 SHFree((LPVOID)pidl); 764 else 765 SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Open"); 766 767 fodInfos->DlgInfos.dwDlgProp |= FODPROP_USEVIEW; 768 769 COMDLG32_SHFree((LPVOID)pidl); 744 770 return hRes; 745 771 } 746 772 if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) 773 SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save"); 774 775 fodInfos->DlgInfos.dwDlgProp &= ~FODPROP_USEVIEW; 747 776 return E_FAIL; 748 777 } … … 780 809 LPIDA cida = (LPIDA)GlobalLock(medium.u.hGlobal); 781 810 TRACE("cida=%p\n", cida); 782 pidlSelected = ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[1]]));811 pidlSelected = COMDLG32_PIDL_ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[1]])); 783 812 784 813 if(medium.pUnkForRelease)
Note:
See TracChangeset
for help on using the changeset viewer.