i want to be able to send text to hwnd. how do i do this
Printable View
i want to be able to send text to hwnd. how do i do this
hWnd is a Long that windows assigns to a window. Windows can, and does change this hWnd depending on what it decides it needs to do with respect to resource allocation. You can send text to an application, but not its handle.
anyone
What is the hWnd of, and what text do you want to send???
Woka
What exactly is it you want to do? As Hack explained already the hWnd is simply a handle to a window, any type of window incl. ListBoxes, CommandButtons and so on. Do you want to change the Caption on a control in another application? Do you want to draw a text on a window that has a device context? Please elaborate otherwise nobody will be able to help you.
send text to a hwnd like i sayd.
i know hwnd is handle of window.
i have API and C++ experience with windows juts not sedning text to them
Like I have already said...What is the hWnd of?
What text do you want to send?
You MUST elaborate on your question instead of repeating yourself over and over again.
We are aware you want to send text to the handle of a window, and the only way to do this is by using API, so we assumed that already.
What is the hWnd of and what text?
Is the hWnd a combobox, text box, listbox...what?
They are different commands for different things.
You cannot just send random text to a random hWnd, nothing will happen.
Woka
hwnd is a ordinairy textbox i think or RTB
Out of interest did you try searching for "API and text and textbox"??? HUNDREDS of results.Code:Option Explicit
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 Form_Load()
Dim strWoof As String
strWoof = "Mooose"
SendMessage Text1.hwnd, WM_SETTEXT, 0&, ByVal strWoof
End Sub
Woka