Results 1 to 9 of 9

Thread: how to send text to a window message

  1. #1

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206

    how to send text to a window message

    i want to be able to send text to hwnd. how do i do this

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how to send text to a window message

    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.

  3. #3

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206

    Re: how to send text to a window message

    anyone

  4. #4

  5. #5
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: how to send text to a window message

    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.

  6. #6

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206

    Re: how to send text to a window message

    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

  7. #7
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: how to send text to a window message

    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

  8. #8

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206

    Re: how to send text to a window message

    hwnd is a ordinairy textbox i think or RTB

  9. #9
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: how to send text to a window message

    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
    Out of interest did you try searching for "API and text and textbox"??? HUNDREDS of results.

    Woka

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