If i have 2 exe's and i want to change the value of a tect box from one exe to the other one knowing the hwnd, how can i do that?
Printable View
If i have 2 exe's and i want to change the value of a tect box from one exe to the other one knowing the hwnd, how can i do that?
Use the SetWindowText API function...
If you know the handle of the textbox, it's a snap.
In a module:
For this example, create a textbox (Text1) and a command button (Command1). Then in the form's code window, paste this:Code:Option Explicit
Public Declare Function SetWindowText Lib "user32.dll" Alias "SetWindowTextA" _
(ByVal hWnd As Long, ByVal lpString As String) As Long
Pretty, cool, huh? It will set the title of regular windows, or the text property of a textbox window.Code:Private Sub Command1_Click()
SetWindowText Text1.hWnd, "Hello"
End Sub
Hope that helps!
~seaweed
What i realy need is to manipulate all the controls of the form knowing only the hwnd of the form because the form have alot of controls.
Something like to create a object form to manipulate all the controls knowing only the hwnd of the form