Ignore:
Timestamp:
Sep 5, 2001, 3:54:53 PM (24 years ago)
Author:
bird
Message:

Added $Id:$ keyword.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/shell32/shv_bg_cmenu.c

    r5618 r6650  
     1/* $Id: shv_bg_cmenu.c,v 1.3 2001-09-05 13:47:00 bird Exp $ */
    12/*
    2  *      IContextMenu
    3  *      ShellView Background Context Menu (shv_bg_cm)
     3 *  IContextMenu
     4 *  ShellView Background Context Menu (shv_bg_cm)
    45 *
    5  *      Copyright 1999  Juergen Schmied <juergen.schmied@metronet.de>
     6 *  Copyright 1999  Juergen Schmied <juergen.schmied@metronet.de>
    67 */
    78#include <string.h>
     
    2425*  IContextMenu Implementation
    2526*/
    26 typedef struct 
    27 {
    28         ICOM_VFIELD(IContextMenu);
    29         IShellFolder*   pSFParent;
    30         DWORD           ref;
     27typedef struct
     28{
     29    ICOM_VFIELD(IContextMenu);
     30    IShellFolder*   pSFParent;
     31    DWORD       ref;
    3132} BgCmImpl;
    3233
     
    3738*   ISVBgCm_Constructor()
    3839*/
    39 IContextMenu *ISvBgCm_Constructor(IShellFolder* pSFParent)
    40 {
    41         BgCmImpl* cm;
    42 
    43         cm = (BgCmImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(BgCmImpl));
    44         ICOM_VTBL(cm)=&cmvt;
    45         cm->ref = 1;
    46         cm->pSFParent = pSFParent;
    47         if(pSFParent) IShellFolder_AddRef(pSFParent);
    48 
    49         TRACE("(%p)->()\n",cm);
    50         shell32_ObjCount++;
    51         return (IContextMenu*)cm;
     40IContextMenu *ISvBgCm_Constructor(IShellFolder* pSFParent)
     41{
     42    BgCmImpl* cm;
     43
     44    cm = (BgCmImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(BgCmImpl));
     45    ICOM_VTBL(cm)=&cmvt;
     46    cm->ref = 1;
     47    cm->pSFParent = pSFParent;
     48    if(pSFParent) IShellFolder_AddRef(pSFParent);
     49
     50    TRACE("(%p)->()\n",cm);
     51    shell32_ObjCount++;
     52    return (IContextMenu*)cm;
    5253}
    5354
     
    5758static HRESULT WINAPI ISVBgCm_fnQueryInterface(IContextMenu *iface, REFIID riid, LPVOID *ppvObj)
    5859{
    59         ICOM_THIS(BgCmImpl, iface);
    60 
    61         TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
    62 
    63         *ppvObj = NULL;
    64 
    65         if(IsEqualIID(riid, &IID_IUnknown))          /*IUnknown*/
    66         {
    67           *ppvObj = This;
    68         }
    69         else if(IsEqualIID(riid, &IID_IContextMenu))  /*IContextMenu*/
    70         {
    71           *ppvObj = This;
    72         }   
    73         else if(IsEqualIID(riid, &IID_IShellExtInit))  /*IShellExtInit*/
    74         {
    75           FIXME("-- LPSHELLEXTINIT pointer requested\n");
    76         }
    77 
    78         if(*ppvObj)
    79         {
    80           IUnknown_AddRef((IUnknown*)*ppvObj);     
    81           TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
    82           return S_OK;
    83         }
    84         TRACE("-- Interface: E_NOINTERFACE\n");
    85         return E_NOINTERFACE;
     60    ICOM_THIS(BgCmImpl, iface);
     61
     62    TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
     63
     64    *ppvObj = NULL;
     65
     66    if(IsEqualIID(riid, &IID_IUnknown))          /*IUnknown*/
     67    {
     68      *ppvObj = This;
     69    }
     70    else if(IsEqualIID(riid, &IID_IContextMenu))  /*IContextMenu*/
     71    {
     72      *ppvObj = This;
     73    }
     74    else if(IsEqualIID(riid, &IID_IShellExtInit))  /*IShellExtInit*/
     75    {
     76      FIXME("-- LPSHELLEXTINIT pointer requested\n");
     77    }
     78
     79    if(*ppvObj)
     80    {
     81      IUnknown_AddRef((IUnknown*)*ppvObj);
     82      TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
     83      return S_OK;
     84    }
     85    TRACE("-- Interface: E_NOINTERFACE\n");
     86    return E_NOINTERFACE;
    8687}
    8788
     
    9192static ULONG WINAPI ISVBgCm_fnAddRef(IContextMenu *iface)
    9293{
    93         ICOM_THIS(BgCmImpl, iface);
    94 
    95         TRACE("(%p)->(count=%lu)\n",This, This->ref);
    96 
    97         shell32_ObjCount++;
    98         return ++(This->ref);
     94    ICOM_THIS(BgCmImpl, iface);
     95
     96    TRACE("(%p)->(count=%lu)\n",This, This->ref);
     97
     98    shell32_ObjCount++;
     99    return ++(This->ref);
    99100}
    100101
     
    104105static ULONG WINAPI ISVBgCm_fnRelease(IContextMenu *iface)
    105106{
    106         ICOM_THIS(BgCmImpl, iface);
    107 
    108         TRACE("(%p)->()\n",This);
    109 
    110         if (!--(This->ref))
    111         {
    112           TRACE(" destroying IContextMenu(%p)\n",This);
    113 
    114           if(This->pSFParent)
    115             IShellFolder_Release(This->pSFParent);
    116 
    117           HeapFree(GetProcessHeap(),0,This);
    118           return 0;
    119         }
    120 
    121         shell32_ObjCount--;
    122 
    123         return This->ref;
     107    ICOM_THIS(BgCmImpl, iface);
     108
     109    TRACE("(%p)->()\n",This);
     110
     111    if (!--(This->ref))
     112    {
     113      TRACE(" destroying IContextMenu(%p)\n",This);
     114
     115      if(This->pSFParent)
     116        IShellFolder_Release(This->pSFParent);
     117
     118      HeapFree(GetProcessHeap(),0,This);
     119      return 0;
     120    }
     121
     122    shell32_ObjCount--;
     123
     124    return This->ref;
    124125}
    125126
     
    129130
    130131static HRESULT WINAPI ISVBgCm_fnQueryContextMenu(
    131         IContextMenu *iface,
    132         HMENU hMenu,
    133         UINT indexMenu,
    134         UINT idCmdFirst,
    135         UINT idCmdLast,
    136         UINT uFlags)
    137 {
    138         HMENU   hMyMenu;
    139         UINT    idMax;
    140        
    141         ICOM_THIS(BgCmImpl, iface);
    142 
    143         TRACE("(%p)->(hmenu=%x indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n",This, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
    144 
    145         hMyMenu = LoadMenuA(shell32_hInstance, "MENU_002");
    146 
    147         idMax = Shell_MergeMenus (hMenu, GetSubMenu(hMyMenu,0), indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS);
    148 
    149         DestroyMenu(hMyMenu);
    150 
    151         return ResultFromShort(idMax - idCmdFirst);
     132    IContextMenu *iface,
     133    HMENU hMenu,
     134    UINT indexMenu,
     135    UINT idCmdFirst,
     136    UINT idCmdLast,
     137    UINT uFlags)
     138{
     139    HMENU   hMyMenu;
     140    UINT    idMax;
     141
     142    ICOM_THIS(BgCmImpl, iface);
     143
     144    TRACE("(%p)->(hmenu=%x indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n",This, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
     145
     146    hMyMenu = LoadMenuA(shell32_hInstance, "MENU_002");
     147
     148    idMax = Shell_MergeMenus (hMenu, GetSubMenu(hMyMenu,0), indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS);
     149
     150    DestroyMenu(hMyMenu);
     151
     152    return ResultFromShort(idMax - idCmdFirst);
    152153}
    153154
     
    156157*/
    157158static void DoNewFolder(
    158         IContextMenu *iface,
    159         IShellView *psv)
    160 {
    161         ICOM_THIS(BgCmImpl, iface);
    162         ISFHelper * psfhlp;
    163         char szName[MAX_PATH];
    164        
    165         IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, (LPVOID*)&psfhlp);
    166         if (psfhlp)
    167         {
    168           LPITEMIDLIST pidl;
    169           ISFHelper_GetUniqueName(psfhlp, szName, MAX_PATH);
    170           ISFHelper_AddFolder(psfhlp, 0, szName, &pidl);
    171          
    172           if(psv)
    173           {
    174             /* if we are in a shellview do labeledit */
    175             IShellView_SelectItem(psv,
     159    IContextMenu *iface,
     160    IShellView *psv)
     161{
     162    ICOM_THIS(BgCmImpl, iface);
     163    ISFHelper * psfhlp;
     164    char szName[MAX_PATH];
     165
     166    IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, (LPVOID*)&psfhlp);
     167    if (psfhlp)
     168    {
     169      LPITEMIDLIST pidl;
     170      ISFHelper_GetUniqueName(psfhlp, szName, MAX_PATH);
     171      ISFHelper_AddFolder(psfhlp, 0, szName, &pidl);
     172
     173      if(psv)
     174      {
     175        /* if we are in a shellview do labeledit */
     176        IShellView_SelectItem(psv,
    176177                    pidl,(SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE
    177178                    |SVSI_FOCUSED|SVSI_SELECT));
    178           }
    179           SHFree(pidl);
    180          
    181           ISFHelper_Release(psfhlp);
    182         }
     179      }
     180      SHFree(pidl);
     181
     182      ISFHelper_Release(psfhlp);
     183    }
    183184}
    184185
     
    187188*/
    188189static BOOL DoPaste(
    189         IContextMenu *iface)
    190 {
    191         ICOM_THIS(BgCmImpl, iface);
    192         BOOL bSuccess = FALSE;
    193         IDataObject * pda;
    194        
    195         TRACE("\n");
    196 
    197         if(SUCCEEDED(pOleGetClipboard(&pda)))
    198         {
    199           STGMEDIUM medium;
    200           FORMATETC formatetc;
    201 
    202           TRACE("pda=%p\n", pda);
    203 
    204           /* Set the FORMATETC structure*/
    205           InitFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL);
    206 
    207           /* Get the pidls from IDataObject */
    208           if(SUCCEEDED(IDataObject_GetData(pda,&formatetc,&medium)))
     190    IContextMenu *iface)
     191{
     192    ICOM_THIS(BgCmImpl, iface);
     193    BOOL bSuccess = FALSE;
     194    IDataObject * pda;
     195
     196    TRACE("\n");
     197
     198    if(SUCCEEDED(pOleGetClipboard(&pda)))
     199    {
     200      STGMEDIUM medium;
     201      FORMATETC formatetc;
     202
     203      TRACE("pda=%p\n", pda);
     204
     205      /* Set the FORMATETC structure*/
     206      InitFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL);
     207
     208      /* Get the pidls from IDataObject */
     209      if(SUCCEEDED(IDataObject_GetData(pda,&formatetc,&medium)))
    209210          {
    210             LPITEMIDLIST * apidl;
    211             LPITEMIDLIST pidl;
    212             IShellFolder *psfFrom = NULL, *psfDesktop;
    213 
    214             LPCIDA lpcida = GlobalLock(medium.u.hGlobal);
    215             TRACE("cida=%p\n", lpcida);
    216            
    217             apidl = _ILCopyCidaToaPidl(&pidl, lpcida);
    218            
    219             /* bind to the source shellfolder */
    220             SHGetDesktopFolder(&psfDesktop);
    221             if(psfDesktop)
    222             {
    223               IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (LPVOID*)&psfFrom);
    224               IShellFolder_Release(psfDesktop);
    225             }
    226            
    227             if (psfFrom)
    228             {
    229               /* get source and destination shellfolder */
    230               ISFHelper *psfhlpdst, *psfhlpsrc;
    231               IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, (LPVOID*)&psfhlpdst);
    232               IShellFolder_QueryInterface(psfFrom, &IID_ISFHelper, (LPVOID*)&psfhlpsrc);
    233    
    234               /* do the copy/move */
    235               if (psfhlpdst && psfhlpsrc)
    236               {
    237                 ISFHelper_CopyItems(psfhlpdst, psfFrom, lpcida->cidl, apidl);
    238                 /* fixme handle move
    239                 ISFHelper_DeleteItems(psfhlpsrc, lpcida->cidl, apidl);
    240                 */
    241               }
    242               if(psfhlpdst) ISFHelper_Release(psfhlpdst);
    243               if(psfhlpsrc) ISFHelper_Release(psfhlpsrc);
    244               IShellFolder_Release(psfFrom);
    245             }
    246            
    247             _ILFreeaPidl(apidl, lpcida->cidl);
    248             SHFree(pidl);
    249            
    250             /* release the medium*/
    251             pReleaseStgMedium(&medium);
    252           }
    253           IDataObject_Release(pda);
    254         }
     211        LPITEMIDLIST * apidl;
     212        LPITEMIDLIST pidl;
     213        IShellFolder *psfFrom = NULL, *psfDesktop;
     214
     215        LPCIDA lpcida = GlobalLock(medium.u.hGlobal);
     216        TRACE("cida=%p\n", lpcida);
     217
     218        apidl = _ILCopyCidaToaPidl(&pidl, lpcida);
     219
     220        /* bind to the source shellfolder */
     221        SHGetDesktopFolder(&psfDesktop);
     222        if(psfDesktop)
     223        {
     224          IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (LPVOID*)&psfFrom);
     225          IShellFolder_Release(psfDesktop);
     226        }
     227
     228        if (psfFrom)
     229        {
     230          /* get source and destination shellfolder */
     231          ISFHelper *psfhlpdst, *psfhlpsrc;
     232          IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, (LPVOID*)&psfhlpdst);
     233          IShellFolder_QueryInterface(psfFrom, &IID_ISFHelper, (LPVOID*)&psfhlpsrc);
     234
     235          /* do the copy/move */
     236          if (psfhlpdst && psfhlpsrc)
     237          {
     238            ISFHelper_CopyItems(psfhlpdst, psfFrom, lpcida->cidl, apidl);
     239        /* fixme handle move
     240        ISFHelper_DeleteItems(psfhlpsrc, lpcida->cidl, apidl);
     241        */
     242          }
     243          if(psfhlpdst) ISFHelper_Release(psfhlpdst);
     244          if(psfhlpsrc) ISFHelper_Release(psfhlpsrc);
     245          IShellFolder_Release(psfFrom);
     246        }
     247
     248        _ILFreeaPidl(apidl, lpcida->cidl);
     249        SHFree(pidl);
     250
     251        /* release the medium*/
     252        pReleaseStgMedium(&medium);
     253      }
     254      IDataObject_Release(pda);
     255    }
    255256#if 0
    256         HGLOBAL  hMem;
    257 
    258         OpenClipboard(NULL);
    259         hMem = GetClipboardData(CF_HDROP);
    260        
    261         if(hMem)
    262         {
    263           char * pDropFiles = (char *)GlobalLock(hMem);
    264           if(pDropFiles)
    265           {
    266             int len, offset = sizeof(DROPFILESTRUCT);
    267 
    268             while( pDropFiles[offset] != 0)
    269             {
    270               len = strlen(pDropFiles + offset);
    271               TRACE("%s\n", pDropFiles + offset);
    272               offset += len+1;
    273             }
    274           }
    275           GlobalUnlock(hMem);
    276         }
    277         CloseClipboard();
     257    HGLOBAL  hMem;
     258
     259    OpenClipboard(NULL);
     260    hMem = GetClipboardData(CF_HDROP);
     261
     262    if(hMem)
     263    {
     264      char * pDropFiles = (char *)GlobalLock(hMem);
     265      if(pDropFiles)
     266      {
     267        int len, offset = sizeof(DROPFILESTRUCT);
     268
     269        while( pDropFiles[offset] != 0)
     270        {
     271          len = strlen(pDropFiles + offset);
     272          TRACE("%s\n", pDropFiles + offset);
     273          offset += len+1;
     274        }
     275      }
     276      GlobalUnlock(hMem);
     277    }
     278    CloseClipboard();
    278279#endif
    279         return bSuccess;
     280    return bSuccess;
    280281}
    281282/**************************************************************************
     
    283284*/
    284285static HRESULT WINAPI ISVBgCm_fnInvokeCommand(
    285         IContextMenu *iface,
    286         LPCMINVOKECOMMANDINFO lpcmi)
    287 {
    288         ICOM_THIS(BgCmImpl, iface);
    289 
    290         LPSHELLBROWSER  lpSB;
    291         LPSHELLVIEW     lpSV;
    292         HWND    hWndSV;
    293 
    294         TRACE("(%p)->(invcom=%p verb=%p wnd=%x)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd);   
    295 
    296         /* get the active IShellView */
    297         if((lpSB = (LPSHELLBROWSER)SendMessageA(lpcmi->hwnd, CWM_GETISHELLBROWSER,0,0)))
    298         {
    299           if(SUCCEEDED(IShellBrowser_QueryActiveShellView(lpSB, &lpSV)))
    300           {
    301             IShellView_GetWindow(lpSV, &hWndSV);
    302           }
    303         }
    304 
    305         if(lpSV)
    306         {
    307           if(HIWORD(lpcmi->lpVerb))
    308           {
    309             TRACE("%s\n",lpcmi->lpVerb);
    310 
    311             if (! strcmp(lpcmi->lpVerb,CMDSTR_NEWFOLDERA))
    312             {
    313               if(lpSV) DoNewFolder(iface, lpSV);
    314             }
    315             else if (! strcmp(lpcmi->lpVerb,CMDSTR_VIEWLISTA))
    316             {
    317               if(hWndSV) SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(FCIDM_SHVIEW_LISTVIEW,0),0 );
    318             }
    319             else if (! strcmp(lpcmi->lpVerb,CMDSTR_VIEWDETAILSA))
    320             {
    321               if(hWndSV) SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(FCIDM_SHVIEW_REPORTVIEW,0),0 );
    322             }
    323             else
    324             {
    325               FIXME("please report: unknown verb %s\n",lpcmi->lpVerb);
    326             }
    327           }
    328           else
    329           {
    330             switch(LOWORD(lpcmi->lpVerb))
    331             {
    332               case FCIDM_SHVIEW_NEWFOLDER:
    333                 DoNewFolder(iface, lpSV);
    334                 break;
    335               case FCIDM_SHVIEW_INSERT:
    336                 DoPaste(iface);
    337                 break;
    338               default:
    339                 /* if it's a id just pass it to the parent shv */
    340                 SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(LOWORD(lpcmi->lpVerb), 0),0 );
    341                 break;
    342             }
    343           }
    344        
    345           IShellView_Release(lpSV);     /* QueryActiveShellView does AddRef*/
    346         }
    347         return NOERROR;
     286    IContextMenu *iface,
     287    LPCMINVOKECOMMANDINFO lpcmi)
     288{
     289    ICOM_THIS(BgCmImpl, iface);
     290
     291    LPSHELLBROWSER  lpSB;
     292    LPSHELLVIEW lpSV;
     293    HWND    hWndSV;
     294
     295    TRACE("(%p)->(invcom=%p verb=%p wnd=%x)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd);
     296
     297    /* get the active IShellView */
     298    if((lpSB = (LPSHELLBROWSER)SendMessageA(lpcmi->hwnd, CWM_GETISHELLBROWSER,0,0)))
     299    {
     300      if(SUCCEEDED(IShellBrowser_QueryActiveShellView(lpSB, &lpSV)))
     301      {
     302        IShellView_GetWindow(lpSV, &hWndSV);
     303      }
     304    }
     305
     306    if(lpSV)
     307    {
     308      if(HIWORD(lpcmi->lpVerb))
     309      {
     310        TRACE("%s\n",lpcmi->lpVerb);
     311
     312        if (! strcmp(lpcmi->lpVerb,CMDSTR_NEWFOLDERA))
     313        {
     314          if(lpSV) DoNewFolder(iface, lpSV);
     315        }
     316        else if (! strcmp(lpcmi->lpVerb,CMDSTR_VIEWLISTA))
     317        {
     318          if(hWndSV) SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(FCIDM_SHVIEW_LISTVIEW,0),0 );
     319        }
     320        else if (! strcmp(lpcmi->lpVerb,CMDSTR_VIEWDETAILSA))
     321        {
     322          if(hWndSV) SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(FCIDM_SHVIEW_REPORTVIEW,0),0 );
     323        }
     324        else
     325        {
     326          FIXME("please report: unknown verb %s\n",lpcmi->lpVerb);
     327        }
     328      }
     329      else
     330      {
     331        switch(LOWORD(lpcmi->lpVerb))
     332        {
     333          case FCIDM_SHVIEW_NEWFOLDER:
     334            DoNewFolder(iface, lpSV);
     335        break;
     336          case FCIDM_SHVIEW_INSERT:
     337            DoPaste(iface);
     338            break;
     339          default:
     340            /* if it's a id just pass it to the parent shv */
     341            SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(LOWORD(lpcmi->lpVerb), 0),0 );
     342        break;
     343        }
     344      }
     345
     346      IShellView_Release(lpSV); /* QueryActiveShellView does AddRef*/
     347    }
     348    return NOERROR;
    348349}
    349350
     
    353354 */
    354355static HRESULT WINAPI ISVBgCm_fnGetCommandString(
    355         IContextMenu *iface,
    356         UINT idCommand,
    357         UINT uFlags,
    358         LPUINT lpReserved,
    359         LPSTR lpszName,
    360         UINT uMaxNameLen)
    361 {       
    362         ICOM_THIS(BgCmImpl, iface);
    363 
    364         TRACE("(%p)->(idcom=%x flags=%x %p name=%p len=%x)\n",This, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
    365 
    366         /* test the existence of the menu items, the file dialog enables
    367            the buttons according to this */
    368         if (uFlags == GCS_VALIDATEA)
    369         {
    370           if(HIWORD(idCommand))
    371           {
    372             if (!strcmp((LPSTR)idCommand, CMDSTR_VIEWLISTA) ||
    373                 !strcmp((LPSTR)idCommand, CMDSTR_VIEWDETAILSA) ||
    374                 !strcmp((LPSTR)idCommand, CMDSTR_NEWFOLDERA))
    375             {   
    376               return NOERROR;
    377             }
    378           }
    379         }
    380 
    381         FIXME("unknown command string\n");
    382         return E_FAIL;
     356    IContextMenu *iface,
     357    UINT idCommand,
     358    UINT uFlags,
     359    LPUINT lpReserved,
     360    LPSTR lpszName,
     361    UINT uMaxNameLen)
     362{
     363    ICOM_THIS(BgCmImpl, iface);
     364
     365    TRACE("(%p)->(idcom=%x flags=%x %p name=%p len=%x)\n",This, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
     366
     367    /* test the existence of the menu items, the file dialog enables
     368       the buttons according to this */
     369    if (uFlags == GCS_VALIDATEA)
     370    {
     371      if(HIWORD(idCommand))
     372      {
     373        if (!strcmp((LPSTR)idCommand, CMDSTR_VIEWLISTA) ||
     374            !strcmp((LPSTR)idCommand, CMDSTR_VIEWDETAILSA) ||
     375            !strcmp((LPSTR)idCommand, CMDSTR_NEWFOLDERA))
     376        {
     377          return NOERROR;
     378        }
     379      }
     380    }
     381
     382    FIXME("unknown command string\n");
     383    return E_FAIL;
    383384}
    384385
     
    387388*/
    388389static HRESULT WINAPI ISVBgCm_fnHandleMenuMsg(
    389         IContextMenu *iface,
    390         UINT uMsg,
    391         WPARAM wParam,
    392         LPARAM lParam)
    393 {
    394         ICOM_THIS(BgCmImpl, iface);
    395 
    396         FIXME("(%p)->(msg=%x wp=%x lp=%lx)\n",This, uMsg, wParam, lParam);
    397 
    398         return E_NOTIMPL;
     390    IContextMenu *iface,
     391    UINT uMsg,
     392    WPARAM wParam,
     393    LPARAM lParam)
     394{
     395    ICOM_THIS(BgCmImpl, iface);
     396
     397    FIXME("(%p)->(msg=%x wp=%x lp=%lx)\n",This, uMsg, wParam, lParam);
     398
     399    return E_NOTIMPL;
    399400}
    400401
    401402/**************************************************************************
    402403* IContextMenu VTable
    403 * 
    404 */
    405 static struct ICOM_VTABLE(IContextMenu) cmvt = 
    406 {       
    407         ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
    408         ISVBgCm_fnQueryInterface,
    409         ISVBgCm_fnAddRef,
    410         ISVBgCm_fnRelease,
    411         ISVBgCm_fnQueryContextMenu,
    412         ISVBgCm_fnInvokeCommand,
    413         ISVBgCm_fnGetCommandString,
    414         ISVBgCm_fnHandleMenuMsg,
    415         (void *) 0xdeadbabe     /* just paranoia (IContextMenu3) */
     404*
     405*/
     406static struct ICOM_VTABLE(IContextMenu) cmvt =
     407{
     408    ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
     409    ISVBgCm_fnQueryInterface,
     410    ISVBgCm_fnAddRef,
     411    ISVBgCm_fnRelease,
     412    ISVBgCm_fnQueryContextMenu,
     413    ISVBgCm_fnInvokeCommand,
     414    ISVBgCm_fnGetCommandString,
     415    ISVBgCm_fnHandleMenuMsg,
     416    (void *) 0xdeadbabe /* just paranoia (IContextMenu3) */
    416417};
    417418
Note: See TracChangeset for help on using the changeset viewer.