declare a SendMessage with ByVal parameters or ByRef

J

Just Me

I declare the following and use it if the msg returns values.

I also declare an SendMessage using ByVal for other calls.

Isn't there a way I can used the SendMessage and in the call tell it to use
ByRef?

Public Declare Auto Function SendMessageRef Lib "user32.dll" Alias
"SendMessage" (ByVal hWnd As IntPtr, ByVal msg As Integer, ByRef wParam As
Integer, ByRef lParam As Integer) As Integer

Thanks



PS

I once read a great internet site that explained in detail ByVal and ByRef
as applied to Value types and Reference types - but I've lost the URL.

Anyone know the address?
 
Z

Zoury

Isn't there a way I can used the SendMessage and in the call tell it to
use

i guess.. what message are you planning to send ?
IIRC, if the message returns you a Structure via a parameter, than you can
pass the struct variable "ByRef As MyStruct" and it should get fill
automaticaly or you can pass it "ByVal As IntPtr" and then use the
Marshal.PtrToStructure() function as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top