LVS_EX_UNDERLINECOLD);
m_pListCtrl->ModifyStyle(LVS_TYPEMASK, LVS_REPORT);
m_pListCtrl->InsertColumn(0, "URL",LVCFMT_LEFT,600,1);
//将本窗口注册到Clipboard Viewer Chain,
//并保存Clipboard Viewer Chain中下一个窗口的句柄
m_hwndNextViewer = SetClipboardViewer();
}
void CMonitorUrlView::OnDestroy()
{
CListView::OnDestroy();
//从Clipboard Viewer Chain注销本窗口
ChangeClipboardChain(m_hwndNextViewer);
}
//Clipboard Viewer注销
void CMonitorUrlView::OnChangeCbChain(HWND hWndRemove, HWND hWndAfter)
{
//如果注销的Clipboard Viewer窗口是本窗口的下一个窗口,
//则修改本窗口保存的下一个窗口句柄,
CView::OnChangeCbChain(hWndRemove,hWndAfter);
if(hWndRemove == m_hwndNextViewer)
m_hwndNextViewer = hWndAfter;
}
//剪贴板内容变化,判断剪贴板中的内容是否为URL地址,如是则显示
void CMonitorUrlView::OnDrawClipboard()
{
CView::OnDrawClipboard();
unsigned int anFormats[] = {CF_TEXT};
unsigned int nFormat =
GetPriorityClipboardFormat(anFormats,sizeof(anFormats));
if(nFormat == CF_TEXT)
{
HGLOBAL hMem;
OpenClipboard();
if(hMem = ::GetClipboardData(CF_TEXT))
{
LPTSTR lpszText = (LPTSTR) GlobalLock(hMem);
CString strURL = lpszText;
strURL = strURL.SpanExcluding("\r\n");
if(strURL.Left(7).CompareNoCase("http://") == 0 (北联网教程,专业提供视频软件下载)
……