|
-
Mar 1st, 2001, 09:37 AM
#1
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?
-
Mar 1st, 2001, 10:03 AM
#2
Fanatic Member
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]
-
Mar 1st, 2001, 10:08 AM
#3
Thanx man, but i would also like to know how to use this const to send text to my textbox?
-
Mar 1st, 2001, 10:12 AM
#4
Fanatic Member
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Mar 1st, 2001, 10:16 AM
#5
Fanatic Member
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]
-
Mar 1st, 2001, 10:41 AM
#6
thanx man, but whatz txtsetter.hwnd and whatz the point of declaring lpstr& variable??
-
Mar 1st, 2001, 12:17 PM
#7
Fanatic Member
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]
-
Mar 1st, 2001, 02:12 PM
#8
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)
-
Mar 1st, 2001, 03:28 PM
#9
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|