level 4
bjyfcx
楼主
'将一个字符串通过PostMessage传送出去
Private Sub PostString(ByVal lngHandle As Long, ByVal strP As String)
Dim intP As Integer, t
Dim intK As Integer
Dim lngAsc As Long
Dim lngP As Long
Dim strT As String
On Error GoTo errSub
For intP = 0 To Len(strP) - 1
strT = Mid(strP, intP + 1, 1)
If Asc(strT) <= 0 Then
lngAsc = AscW(StrConv(strT, 128))
If lngAsc < 0 Then
lngAsc = lngAsc + 65536 '2^16
End If
Else
lngAsc = Asc(strT)
End If
lngP = PostMessage(lngHandle, WM_CHAR, lngAsc, 0)
Next intP
Exit Sub
errSub:
End Sub
字符串中有回车换行符 Chr(13) & Chr(10),其他字符都没问题,唯独这回车换行符不行,怎么回事?
2021年05月30日 05点05分
1
Private Sub PostString(ByVal lngHandle As Long, ByVal strP As String)
Dim intP As Integer, t
Dim intK As Integer
Dim lngAsc As Long
Dim lngP As Long
Dim strT As String
On Error GoTo errSub
For intP = 0 To Len(strP) - 1
strT = Mid(strP, intP + 1, 1)
If Asc(strT) <= 0 Then
lngAsc = AscW(StrConv(strT, 128))
If lngAsc < 0 Then
lngAsc = lngAsc + 65536 '2^16
End If
Else
lngAsc = Asc(strT)
End If
lngP = PostMessage(lngHandle, WM_CHAR, lngAsc, 0)
Next intP
Exit Sub
errSub:
End Sub
字符串中有回车换行符 Chr(13) & Chr(10),其他字符都没问题,唯独这回车换行符不行,怎么回事?