Ejemplo n.º 1
0
void CClipSpyListCtrl::Init()
{
    SetExtendedListViewStyle ( LVS_EX_FULLROWSELECT );

    InsertColumn ( 0, _T("Format"), LVCFMT_LEFT, 0, 0 );
    InsertColumn ( 1, _T("Data size"), LVCFMT_LEFT, 0, 1 );

    SetColumnWidth ( 0, LVSCW_AUTOSIZE_USEHEADER );
    SetColumnWidth ( 1, LVSCW_AUTOSIZE_USEHEADER );

    // Register this window as a clipboard viewer.  This makes us get the
    // WM_DRAWCLIPBOARD and WM_CHANGECBCHAIN messages.  The 
    // m_bCallingSetClipboardViewer is necessary because SetClipboardViewer()
    // sends us a WM_DRAWCLIPBOARD but we must not process it.  See
    // OnDrawClipboard() for more details.
    m_bCallingSetClipboardViewer = true;
    m_hwndNextClipboardViewer = SetClipboardViewer();
    m_bCallingSetClipboardViewer = false;

    // Init our drop target object
//     m_pDropTarget = CDropTargetImpl<CClipSpyListCtrl>::CreateMe ( this );
// 
//     if ( m_pDropTarget )
//         m_pDropTarget->InitializeDT();

    // Read the stuff on the clipboard, if there is any.
    ReadClipboard();
}
Ejemplo n.º 2
0
String ReadClipboardText()
{
#ifdef PLATFORM_WINCE
	return ReadClipboardUnicodeText().ToString();
#else
	String s = ReadClipboard((const char *)CF_TEXT);
	return String(s, (int)strlen(~s));
#endif
}
Ejemplo n.º 3
0
void CClipSpyListCtrl::OnDrawClipboard()
{
    // Note the m_bCallingSetClipboardViewer flag.  This flag is set before
    // the call to SetClipboardViewer().  We get a WM_DRAWCLIPBOARD message
    // before SetClipboardViewer() returns, but we must not process it.
    // So we don't do anything if that flag is set.

    if ( !m_bCallingSetClipboardViewer )
        {
        // If there is a next clipboard viewer, pass the message on to it.
        if ( NULL != m_hwndNextClipboardViewer )
            ::SendMessage ( m_hwndNextClipboardViewer, WM_DRAWCLIPBOARD, 0, 0 );

        // Read the contents of the clipboard.
        ReadClipboard();
        }
}
Ejemplo n.º 4
0
String PasteClip::Get(const char *fmt) const
{
	return dnd ? dndloop ? dndloop->GetData(fmt) : String() : ReadClipboard(fmt);
}
Ejemplo n.º 5
0
String PasteClip::Get(const char *fmt) const
{
	if(this == &Ctrl::Selection())
		return Null;
	return dt ? UPP::Get(dt, fmt) : ReadClipboard(fmt);
}
Ejemplo n.º 6
0
WString ReadClipboardUnicodeText()
{
	String s = ReadClipboard((const char *)CF_UNICODETEXT);
	return WString((const wchar *)~s, wstrlen((const wchar *)~s));
}
Ejemplo n.º 7
0
void CClipSpyListCtrl::OnReadClipboard ( UINT uCode, int nID, HWND hwndCtrl )
{
    ReadClipboard();
}