Guidance
指路人
g.yi.org
Guidance Forums / Rapid-Q Basic / problem with windows API call

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. problem with windows API call
#1061
Posted by: 2003-08-11 21:45:22
could you please help me (if you understand my very bad english !!) ?
I use this code  in VB to get any form's title (with the handle 'hwnd') and it works
In RapidQ,  TrimSpace is always empty after  Sendmessagebystring() call



Declare Function Sendmessagebynum Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) 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 string
 
Function GetText(hwnd) As String

dim TrimSpace as string
dim GetTrim as long
dim GetText as string

GetTrim = Sendmessagebynum(hwnd, 14, 0&, 0&)
TrimSpace = SPACE$(GetTrim)
GetText = Sendmessagebystring(hwnd, 13, GetTrim + 1, TrimSpace)
'HERE TrimSpace STAY EMPTY AFTER THE CALL
GetText = TrimSpace  
'GetText = "" !
End Function
Message2. Re: problem with windows API call
#1062
Posted by: cajino 2003-08-12 15:03:19
Try this:
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByRef lpString As String, ByVal cch As Long) As Long

Then, in your function:
Dim MyStr As String
MyStr = Space$(100)
GetWindowText (Form.Handle, MyStr, 100)

Now MyStr is the title of your window

Bye
Cajino
Message3. Re: problem with windows API call
#1063
Posted by: 2003-08-12 20:08:17
thank you for your answer
in fact  GetWindowText gives me only the window's title
my function SendMessagebystring is able to give me window's title AND the value of any textbox in the form (with the textbox.handle)
The idea was to program a password recover tool
With GetCursorPos then WindowFromPoint  API calls, i get the password.textbox.handle from the authentification window under the mouse pointer
Then with Sendmessagebystring(hwnd,...) i get the "******"  (password.textbox.value) in clear
.......i'm not sure of my english........
i tried SENDMESSAGE RapidQ function (in RapidQ help) with the same parameters but TrimSpace stay empty
i don't understand why this code works well in VB and not in RapidQ
could you help me on that point

thx very much
Message4. Re: problem with windows API call
#1064
Posted by: 2003-08-13 07:11:56

SendmessageA will always return a LONG, maybe a pointer to a String, ...
To help you I need to know more about the type of message that you sent

BTW, I tried to do that with gettext too  and like you I could only got titles ...

So I am interested by your method !

Une Fois ...

Jacques
Message5. Re: problem with windows API call
#1067
Posted by: guidance 2003-08-13 11:03:02
Check spyinfo: http://g.yi.org/_scripts/file.php?f=1474&r=2330
Message6. Re: problem with windows API call
#1071
Posted by: 2003-08-13 19:28:50
thx for your help Jacques, i suppose your from belgium so you might prefer take a look to my query in french version !
>> http://j.lypstenger.free.fr/forums/viewtopic.php?t=129
(i posted my codes in this forum)
une fois...

i'll take a look to guidance's link, thx for the information
Message7. Re: problem with windows API call
#1072
Posted by: 2003-08-13 19:34:32
thank you guidance that's exactly what i looked for !
Message8. Re: problem with windows API call
#1073
Posted by: 2003-08-13 19:48:43
euh... sorry i said it too quickly
LH = GETWINDOWTEXT(NEWHND,@BFR, 100)
in SPYINFO3A.RQB gives textbox.values but it does not work with textbox in *.dun application....
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-3-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0