Page 1 of 1

API call - How to?

Posted: Tue Apr 30, 2013 4:06 pm
by C?sar Baptista
Hi everyone,

I have a problem which is related to pass a record to api.
Example:

How to call SendMessage passing in lParam a RECT record.

Record Rect
     Left As Long
     Top As Long
     Right As Long
     Bottom As Long
End Record
...
With SendMessageApi
     hwnd = {Some Handler}
     wMsg = SEM_SETBOUNDS
     wParam = 0
     lParam = {Rect Record} <- Here is where i need the record to pass
     Execute
End With

Thanks in advance.

API call - How to?

Posted: Thu May 02, 2013 3:55 pm
by Marco
Hi, here`s an example.  You have to try it out.
I did not testet it because it`s not a filled in example.
I hope it helps otherwise send a message or comment.
best regards marco

Record Rect
  Left As Long
  Top As Long
  Right As Long
  Bottom As Long
End Record

Declare Send as "SendMessageA" of "user32"
  hwnd As Long
  wMsg As Long
  wParam As Long
  lParam As rect
  result as long
end declare

send.hwnd=[windows handle of object]
send.wmsg=SEM_SETBOUNDS
send.wparam=0
`the rect values, rect is declared as lparam in the api send
send.lparam.left=100
send.lparam.top=100
send.lparam.right=100
send.lparam.bottom=100

send.execute
showmessage send.result ``get the result value

API call - How to?

Posted: Thu May 02, 2013 4:10 pm
by C?sar Baptista
Hi Marco,

Thanks for the example.
I will try it and then say if it worked.

C?sar Baptista

API call - How to?

Posted: Thu May 02, 2013 10:23 pm
by C?sar Baptista
Marco,

It Worked. ;)

Thank you very much.