wpDrop - Example Code

In this example, objects that are not file system objects are prevented from being dropped on the Browse_O_matic.

SOM_Scope MRESULT   SOMLINK Browse_O_Maticwps_wpDrop(Browse_O_Matic *somSelf,
                HWND hwndCnr,
                PDRAGINFO pdrgInfo,
                PDRAGITEM pdrgItem)
{
    CHAR    pszBuffer[ 255 ];
    MRESULT mResult;

    /* Browse_O_MaticData *somThis = Browse_O_MaticGetData(somSelf); */
    Browse_O_MaticMethodDebug("Browse_O_Matic","Browse_O_Maticwps_wpDrop");

    mResult = MRFROM2SHORT( DOR_DROP, 0);

    /***************************************************************/
    /* Don't call the parent. Initialize mResult to allow the drop */
    /* to proceed.                                                 */
    /***************************************************************/
    if( DOR_NEVERDROP != SHORT1FROMMR( mResult) &&
                                 DrgVerifyRMF( pdrgItem, "DRM_OS2FILE", NULL)){

        /* Get the path */
        DrgQueryStrName( pdrgItem->hstrContainerName, sizeof( pszBuffer),
                                                                    pszBuffer);

        /* Append the name of the object to the path */
        DrgQueryStrName( pdrgItem->hstrSourceName,
                                       sizeof( pszBuffer) - strlen( pszBuffer),
                                              &pszBuffer[ strlen( pszBuffer)]);
        _wpViewObject( somSelf, NULLHANDLE, OPEN_DEFAULT, (ULONG)pszBuffer);

        mResult = MRFROM2SHORT( DOR_DROP, SHORT2FROMMR( mResult));
    }
    else
        mResult = MRFROMSHORT( DOR_NEVERDROP );

    return( mResult );
}


[Back: wpDrop - Related Methods]
[Next: wpDrop - Topics]