lParam

Jedhi

Well-known member
Joined
Oct 2, 2003
Messages
127
I have in C++ used the message parameter lParam to see the result of an operation.

example :

byte status = (byte) lParam

if (status == ANSWER_ACCEPTED)
etc..

Now I would like to do the simalar in C#. Are there any method I can use or do I have do wrap the win32 ??
 
I was just interesting to know if there where any method to use when you want to know the result of an operation. There must be !

Or do I have to wrap [DllImport("user32")] to get the benefits of SendMessage.
 
It really depends on what you are trying to do, if you are calling the windows API you will need to continue using the same techniques as always to get status / error codes back.
If you want to use the SendMessage API you will need to use DllImport to be able to call it.

However if you gave more details about what you are trying to acheive there may be a .Net way to do it.
 
I think that using MessageQueueTransaction I obtain the same thing as SendMessage, but I am not sure !!!!

public void OperationCompleted(System.Messaging.Message msg)
{
MessageQueueTransaction mqtx = new MessageQueueTransaction();

if(mqtx.Status == MessageQueueTransactionStatus.Pending)
{
mqtx.abort;
}
else
if(mqtx.Status == MyCodeStatus)
{
statusfield.Text("This is my code status");
}
 
Back
Top