|
-
Sep 29th, 2000, 03:14 PM
#1
Thread Starter
Hyperactive Member
I got a few problems...
What do you do when you use a GetText Function to get the text on a window and nothing comes back? Like you know for a fact your code is right and bug free. I thinking the window has something blocking API or something. Some windows and objects dont let you use API on them is that possible? Some windows/objects you can't hide. Like Ad bars that dock on ur computer and stuff. How can you hide em? Also I know of one window i have you can SEE it has a title bar and a caption in it, but an API spy can get it's caption.
- How do you get around all of this? -
- How can I hide the windows i want to hide, and get text from objects that have text in em like a text box or maybe password box, or even a label, and captions? -
Maybe theres something I would use instad of API??
Please help...
My GetText Function:
Code:
Public Function GetText(WindowHandle As Long) As String
Dim TheText As String, TL As Long
TL = SendMessageLong(WindowHandle, WM_GETTEXTLENGTH, 0&, 0&)
TheText = String(TL + 1, " ")
Call SendMessageByString(WindowHandle, WM_GETTEXT, TL + 1, TheText)
TheText = Left(TheText, TL)
GetText$ = TheText
End Function
-
Sep 29th, 2000, 08:52 PM
#2
Corrected Code:
1. GetText shouldn't have a $ next to it-it is already a string.
2. Sendmessagelong? That never existed, so use Sendmessage.
Code:
Public Function GetText(WindowHandle As Long) As String
Dim TheText As String, TL As Long
TL = SendMessage(WindowHandle, WM_GETTEXTLENGTH, 0&, 0&)
TheText = String(TL + 1, " ")
Call SendMessage(WindowHandle, WM_GETTEXT, TL + 1, TheText)
TheText = Left(TheText, TL)
GetText = TheText
End Function
-
Sep 29th, 2000, 09:04 PM
#3
-
Sep 29th, 2000, 09:08 PM
#4
Thread Starter
Hyperactive Member
The GetText code works, i know for a fact it does.
just gotta have this stuff:
Code:
Public Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
that $ dosn't really mater..
It's like no nody knows this stuff, its getting no replys..
Common i know someone knows what i'm looking for out there!!
-
Sep 29th, 2000, 09:10 PM
#5
Thread Starter
Hyperactive Member
No i don't just want to get a windows text. Read what i said before. Thats just the code i use sometimes. I don't even know really i put the code on there.
-
Sep 29th, 2000, 10:18 PM
#6
Code:
Public Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, [ByVal]- lParam As String) As Long
I know that!
The $ would just cost you an extra byte.
Oh, and you forgot that ByVal passes a varible BY VALUE, meaning that it cannot change the actually value.
Happy now? Obviuously, API Viewer...*_*
-
Sep 29th, 2000, 10:28 PM
#7
New Member
Urrr...
Could you not say that I don't know everything without posting everything?
Obviously, if you haven't posted this, how would I know what happened? No offense.
Brief, for all our sakes, turn off that darn VB!
Escaflowne's Omega Helper  .
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
|