Click to See Complete Forum and Search --> : Wm_Set.....
Zambi
Mar 1st, 2001, 08:37 AM
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?
crispin
Mar 1st, 2001, 09:03 AM
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
Thanx man, but i would also like to know how to use this const to send text to my textbox?
crispin
Mar 1st, 2001, 09:12 AM
Textbox or ComboBox?
crispin
Mar 1st, 2001, 09:16 AM
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
thanx man, but whatz txtsetter.hwnd and whatz the point of declaring lpstr& variable??
crispin
Mar 1st, 2001, 11:17 AM
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,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)
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.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.