16,548
社区成员




AllowMeesageForVistaAbove( WM_DROPFILES, TRUE );
AllowMeesageForVistaAbove( 0x0049, TRUE ); // 0x0049 - WM_COPYGLOBALDATA
bool CXXX::AllowMeesageForVistaAbove( WM_DROPFILES, TRUE )
{
typedef BOOL (WINAPI* _ChangeWindowMessageFilter)( UINT, DWORD );
HMODULE hUserMod = NULL;
BOOL bResult = FALSE;
hUserMod = LoadLibrary( "user32.dll" );
if ( hUserMod == NULL )
{
return FALSE;
}
_ChangeWindowMessageFilter pChangeWindowMessageFilter = (_ChangeWindowMessageFilter)GetProcAddress( hUserMod, "ChangeWindowMessageFilter" );
if ( NULL == pChangeWindowMessageFilter )
{
FreeLibrary( hUserMod );
return FALSE;
}
bResult = pChangeWindowMessageFilter( uMessage, bAllow ? 1 : 2 ); // 1-MSGFLT_ADD, 2-MSGFLT_REMOVE
if( NULL != hUserMod )
{
FreeLibrary( hUserMod );
}
return bResult;
}
COleDropInfo* pInfo = (COleDropInfo* )pDropInfoClass;
ASSERT( pInfo->IsKindOf( RUNTIME_CLASS( COleDropInfo ) ) );
UINT format = RegisterClipboardFormat( CONTACT_DATA_FORMAT );
if( pInfo->m_pDataObject->IsDataAvailable( format ) )
{
return DROPEFFECT_COPY;
}
else
{
return DROPEFFECT_NONE;
}
消息没有被Post给OnDropFiles( WPARAM wParam, LPARAM lParam ),
但是在XP下一切正常,请问这竟然是什么原因呢