I know that the topic is mundane, but I couldn’t be able to output the text copied to the buffer to the console window with the lockable network ... And the English text is displayed normally. What is the problem? How to be? Thank.
- oneIn general, the question more comes down to how to get the data from the buffer in a normal "form" ... - Alerr
- And what is your compiler? If VC ++, then try to go to Project Properties -> General -> Character Set -> Use Multibyte Encoding. - brightside90
|
1 answer
if( OpenClipboard(NULL) ) { char* data = (char*)GetClipboardData(CF_TEXT); if(data) { ;//делай что хочешь с данными, например - выводи на консоль if (isatty(fileno(stdout))) { printf ("recode\n"); CharToOem(data,data); } printf ("data: <%s>\n",data); } CloseClipboard(); }
Like so.
- VS 2010 swears at isatty and error C2664: 'CharToOemW': cannot convert parameter 1 from 'char *' to 'LPCWSTR' - Alerr
- Thanks, did .... - Alerr
|