Jedhi Posted February 3, 2004 Posted February 3, 2004 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 ?? Quote
Administrators PlausiblyDamp Posted February 3, 2004 Administrators Posted February 3, 2004 The result of what operation? Wrap which Win32 API? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Jedhi Posted February 3, 2004 Author Posted February 3, 2004 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. Quote
NK2000 Posted February 3, 2004 Posted February 3, 2004 yes you have to use the dllimport attribute to get the sendmessage this might help: http://msdn.microsoft.com/netframework/default.aspx?pull=/library/en-us/dndotnet/html/win32map.asp Quote
Administrators PlausiblyDamp Posted February 3, 2004 Administrators Posted February 3, 2004 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Jedhi Posted February 3, 2004 Author Posted February 3, 2004 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"); } Quote
Recommended Posts