#include "stdafx.h"
#include "nopepad.h"

int GetClipTextLength( HWND hWnd )
{
	int Ret=-1;

	OpenClipboard( hWnd );
	HANDLE hText = GetClipboardData( CF_TEXT );
	if( hText )
	{
		char* pTmp = (char*)GlobalLock( hText );
		if( pTmp )
			Ret = strlen(pTmp);
		GlobalUnlock( hText );
	}

	CloseClipboard();
	return( Ret );
}