ERLEDIGT
NEIN
NEIN
ANTWORTEN
0
0
ZUGRIFFE
628
628
EMPFEHLEN
-
Hallo Leute nochmal,
folgendes Problem:
Bei einer Protokoll-Anzeige haben wir einen Button, der entweder eine Selektion oder einen ganzen Text ins Clipboard speichert.
Da dies HTML-Text inkl. Bilder etc. sein kann, haben wir folgende Funktion:
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
Public Sub PutHTMLClipboard(sHtmlFragment As String) On Error Resume Next Me.MousePointer = vbHourglass If RegisterCF <> 0 Then Const sContextStart = "<HTML><BODY>" Const sContextEnd = "</BODY></HTML>" Dim sData As String ' 'Build the HTML given the description, the fragment and the context. ' 'And, replace the offset place holders in the description with values ' 'for the offsets of StartHMTL, EndHTML, StartFragment and EndFragment. sData = m_sDescription & sContextStart & sHtmlFragment & sContextEnd sData = Replace(sData, "aaaaaaaaaa", _ Format$(Len(m_sDescription), "0000000000")) 'MLHIDE sData = Replace(sData, "bbbbbbbbbb", Format$(Len(sData), "0000000000")) 'MLHIDE sData = Replace(sData, "cccccccccc", Format$(Len(m_sDescription & _ sContextStart), "0000000000")) 'MLHIDE sData = Replace(sData, "dddddddddd", Format$(Len(m_sDescription & _ sContextStart & sHtmlFragment), "0000000000")) 'MLHIDE 'Add the HTML code to the clipboard If CBool(OpenClipboard(0)) Then Dim hMemHandle As Long, lpData As Long hMemHandle = GlobalAlloc(0, Len(sData) + 10) If CBool(hMemHandle) Then lpData = GlobalLock(hMemHandle) If lpData <> 0 Then CopyMemory ByVal lpData, ByVal sData, Len(sData) GlobalUnlock hMemHandle EmptyClipboard SetClipboardData m_cfHTMLClipFormat, hMemHandle End If End If Call CloseClipboard End If End If Me.MousePointer = vbNormal End Sub
Klappt soweit gut, doch leider werden Umlaute nicht richtig erkannt. Leider ist es nicht möglich eine Funktion zu machen, welche diese umwandelt. Dies haben wir bereits versucht, doch bei diversen Emails etc. hat dies zu Problemen geführt.
Das Problem ist, wenn normal Ctrl+C benutzt wird, klappen sowohl die Umlaute als auch die Bilder etc., daher muss es irgendwie möglich sein, dies sauber hinzukriegen.
Wie immer vielen Dank im VOraus.
Ähnliche Themen
-
Umlaute und Dateien die man nicht öffnen kann
Von Nord-Süd-Richtung im Forum C/C++Antworten: 10Letzter Beitrag: 17.01.09, 17:53 -
Kann aus MySQL lesen aber nicht schreiben
Von SlowMoe im Forum PHPAntworten: 4Letzter Beitrag: 24.05.06, 14:11 -
[Phase 5] HTML Editor wandelt Umlaute im Quelltext um, wie kann ich es verhindern
Von son gohan im Forum HTML-EditorenAntworten: 4Letzter Beitrag: 26.04.06, 12:41 -
NETSCAPE kann CSS nicht lesen grrrr
Von timeout im Forum CSSAntworten: 12Letzter Beitrag: 17.08.04, 00:11





Zitieren
Login





