Results 1 to 4 of 4

Thread: Passing strings

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    Yugoslavia
    Posts
    16

    Wink

    How to pass a string to an object outside of my app, if I have it's handle?

  2. #2
    Guest
    What do you mean "pass a string." Give an example of what you want to do?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    Yugoslavia
    Posts
    16

    Wink

    Like I have a textbox control and it's handle, and I want it to contain a custom string (exp. "Hello world"), that is what I mean by passing a string, but am not sure if this is possible, I mean to pass a complete string. If not I think it's possible to simulate a KeyDown method over that textbox, but I don't know how!

  4. #4
    Guest
    Try sending the WM_SETTEXT message.
    Code:
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Private Const WM_SETTEXT = &HC
    
    Private Sub Command1_Click()
        SendMessage Text1.hwnd, WM_SETTEXT, 0, ByVal "My New Text"
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width