琢磨半天,不得思路请指点,谢谢各位大虾,

解决方案 »

  1.   

    Option ExplicitPrivate intCnt As LongPrivate Sub Command1_Click()intCnt = 0intCnt = SendMessage(Text1.hwnd, EM_GETLINEcount, 0, ByVal 0)
    Timer1.Enabled = TrueEnd SubPrivate Sub Timer1_Timer()Static i As Integer
    Dim str(256) As Byte
    Dim strLine As String
    Dim intLen As Integer
    Static strSend As Stringstr(1) = 1
    If i = intCnt Then
        i = 0
        strSend = ""
        Timer1.Enabled = False
        Exit Sub
    End Ifi = i + 1
    'Debug.Print SendMessage(Text1.hwnd, EM_GETTEXTRANGE, 3, eText)
    intLen = SendMessage(Text1.hwnd, EM_GETLINE, i - 1, str(0))
    strLine = StrConv(str, vbUnicode)
    strLine = Left(strLine, intLen) & vbCrLf
    'Debug.Print "|" & strLine & "|"
    strSend = strSend & strLine
    SendMessage Text2.hwnd, WM_SETTEXT, 0, ByVal strSendEnd Sub
    基本上就这样了,我是用两个textbox进行调试的,如果你要通过程序之间传递,需要先用
    findwindow和findwindowex找到那个文本框的hwnd,然后再用上面的代码。
    窗口上放两个textbox,(text1里面写几行字,text1和text2都设置成多行显示)一个timer(interval = 1000)和一个按钮。
      

  2.   

    EM_GETLINECOUNT = &HBA
    EM_GETLINE = &HC4
    WM_SETTEXT = &HCPublic Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
      

  3.   

    rappercn(rapper十分感谢马上结帐