I want this program to wait untill I copy some text into my clipboard. This is what I have done so far
char text[500] ;
HANDLE clip ;
if ( OpenClipboard (NULL) )
cout << "\nClipboard opened" ;
EmptyClipboard () ;
cout << "\nStart" ;
while ( true )
{
if ( GetClipboardData (CF_TEXT) != NULL )
{
cout<<"\ninside";
clip = GetClipboardData (CF_TEXT);
break ;
}
}
/*if ( OpenClipboard (NULL) )
clip = GetClipboardData (CF_TEXT);*/
strcpy ( text, (char*)clip ) ;
cout << "\n" << text ;
But its no working properly. Start
gets printed but after that nothing happens. It never goes inside if
( also I'm at first cleaning up my clipboard so that I first start the program and then I copy some text into clipboard ) .