API call - How to?

In this category you can exchange your programming questions and solutions.
Post Reply
C?sar Baptista
Posts: 6
Joined: Tue Apr 30, 2013 10:35 am

API call - How to?

Post: # 1068Post C?sar Baptista
Tue Apr 30, 2013 4:06 pm

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.

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

API call - How to?

Post: # 1069Post Marco
Thu May 02, 2013 3:55 pm

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

C?sar Baptista
Posts: 6
Joined: Tue Apr 30, 2013 10:35 am

API call - How to?

Post: # 1070Post C?sar Baptista
Thu May 02, 2013 4:10 pm

Hi Marco,

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

C?sar Baptista

C?sar Baptista
Posts: 6
Joined: Tue Apr 30, 2013 10:35 am

API call - How to?

Post: # 1071Post C?sar Baptista
Thu May 02, 2013 10:23 pm

Marco,

It Worked. ;)

Thank you very much.

Post Reply