Click to See Complete Forum and Search --> : Passing strings
Dejvi
Feb 24th, 2001, 03:28 PM
How to pass a string to an object outside of my app, if I have it's handle?
What do you mean "pass a string." Give an example of what you want to do?
Dejvi
Feb 25th, 2001, 08:40 AM
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!
Try sending the WM_SETTEXT message.
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.