Results 1 to 9 of 9

Thread: Wm_Set.....

  1. #1
    Zambi
    Guest
    Const WM_SetText = ??? I have no idea what this equals. Can i also know how to use this function to put text in my comboBo?

  2. #2
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    Private Const WM_SETTEXT = &HC

    I found that the best way to look these Consts up is to search MSDN for them, look at the bottom of the definition, this will tell you the header file in which they are located. Then (you need the platform SDK for this) go to the include directory of your Platform SDK and grab the value from the header file (if that makes sense)

    hope this helps
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  3. #3
    Guest
    Thanx man, but i would also like to know how to use this const to send text to my textbox?

  4. #4
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    Textbox or ComboBox?
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  5. #5
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    Option Explicit
    Private Const WM_SETTEXT = &HC
    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 Sub cmdSetText_Click()
    Dim sStr$
    Dim lpStr&
    sStr = "HELLO"
    SendMessage txtSetter.hwnd, WM_SETTEXT, 0&, ByVal sStr
    End Sub
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  6. #6
    Guest
    thanx man, but whatz txtsetter.hwnd and whatz the point of declaring lpstr& variable??

  7. #7
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    dont worry about lpstr&, thats redundant, I was messing about with StrPtr and some other stuff.

    txtSetter.hWnd is the hWnd of the Textbox you want to send the message to, i.e. TextBoxName.hWnd
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  8. #8
    Guest

    sorry..

    Crispin,sorry to bother you again, but i have onelittle problem. I tried ure code for my textBox and it worked, but now i want to use WM_Settext to help me write a program that sends text to an aol chatroom wheni the user pressesthesend button. I wrote the code for the program, and everything works except for the WM_Settext part. Can u please take a look at my code and try to let me know what the problem is?

    Here it is(the section of the program code thatz responsible for finding the aol chatroom textbox(RICHCNTL) AND SENDING TEXT TO IT.

    by the way, "Hey'is suppose to be the text that is sent to the chatroom when the commandbutton is pressed.



    Private Sub Command1_Click()
    Dim H As Long, aolframe As Long, _
    mdiclient As Long, aolchild As Long, _
    aolicon As Long


    H = "Hey"

    aolframe = FindWindow("AOL Frame25", vbNullstring)
    mdiclient = FindWindowEx(aolframe, 0&,
    _MDIClient", vbnullstring)
    aolchild = FindWindowEx(mdiclient, 0&, "AOL Child"_
    , vbNullstring)
    aolicon =FindWindowEx(aolchild, 0&, _
    "RICHCNTL", vbNullString)


    Call SendMessage(aolicon, WM_Settext, 0&, Byval H)

  9. #9
    Guest
    Originally posted by crispin
    txtSetter.hWnd is the hWnd of the Textbox you want to send the message to, i.e. TextBoxName.hWnd
    If you want to get the hWnd of windows that are not in your App, then use the FindWindowEx.

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