Dos - Converte caratteri Windows in DOS e vicevers




Private Declare Function OemToCharBuff Lib "user32" Alias "OemToCharBuffA" _
(ByVal lpszSrc As String, ByVal lpszDst As String, ByVal cchDstLength As Long) As Long

Private Declare Function CharToOemBuff Lib "user32" Alias "CharToOemBuffA" _
(ByVal lpszSrc As String, ByVal lpszDst As String, ByVal cchDstLength As Long) As Long


Dim x As String
Dim y As String
Dim l As Long
Dim n As Long

Private Sub Command1_Click()

x = "a' e' i' o' u' £" ' stringa OEM
y = Space(Len(x))
l = Len(x)
n = OemToCharBuff(x, y, l)
Label4 = y ' la variabile y contiene la stringa ANSI equivalennte "Ó Ú ý = ¨ ú"




End Sub

Private Sub Command2_Click()
x = "Ó Ú ý = ¨ ú" ' stringa ANSI
y = Space(Len(x))
l = Len(x)
n = CharToOemBuff(x, y, l)
Label2 = y
End Sub





Private Sub Text1_Change()
x = Text1.Text
y = Space(Len(Text1.Text))
l = Len(Text1.Text)
n = OemToCharBuff(x, y, l)
Text2.Text = y

End Sub











( dosconvertecaratteriwindowsindosevicevers.html )- by Paolo Puglisi - Modifica del 17/12/2023