본문 바로가기

Projects/CoVNC

html을 클립보드에 복사

rich text의 경우 richedit.h만 include해주면 MFC가 아닌 Win32 API를 사용하는 프로그램에서도CF_RTF를 사용할 수 있었지만 HTML은 아직 발견하지 못했네요.
다음 예는 msdn에 올라와있는 예제입니다만,,, MFC에서만 사용가능 한 것으로 생각됩니다...
RegisterClipboardFormat("HTML Format"); 함수를 사용했고 이것을 사용해 setClipboardData()함수를 호출 하였지만 클립보드에 html 데이터가 들어가지 못합니다...
그나저나 빨리 CF_HTML 을 사용할 수 있도록 하는 방법을 찾아야 하는데,,, 잠도 못자고 죽겠네여....


How To Add HTML Code to the Clipboard by Using Visual C++


 When you use this function to copy an HTML code fragment to the clipboard, it might look like the following:

    char *html = 
        "<b>This is a test</b><hr>"
        "<li>entry 1"
        "<li>entry 2";
    CopyHTML(html);


Additional Note

Using an approach that sends HTML code to the clipboard might be especially beneficial for Office Automation clients. For example, if you have an Automation client that needs to generate formatted data for cells in Microsoft Excel or paragraphs in Microsoft Word, you could build the data in HTML code, send it to the clipboard, and then paste it into the application. By using this technique, you could reduce the number of out-of-process calls to the Automation client.


REFERENCES

To learn more about the specifics of the HTML Clipboard format, see the topic "HTML Clipboard Format" in the MSDN:

'Projects > CoVNC' 카테고리의 다른 글

error LNK2001: unresolved external symbol _main  (1) 2007.09.17
탭스 업로드 3.0  (0) 2007.08.03
CF_RTF를 사용하기위해...  (0) 2007.07.24
Msftedit.dll과 CF_RTF  (0) 2007.07.24
다중포멧 클립보드를 위한 글들...  (0) 2007.07.23