Marshal && Hwnd - Please Help

  • Thread starter Thread starter Juan Irigoyen
  • Start date Start date
J

Juan Irigoyen

I have the next code

byte[] data = new byte[14];
Marshal.Copy(this.Hwnd, data, 0, 4);

this code compiled well, but when i execute the code receive a error.

How can copy this.Hwnd (Handle of MessageWindow type IntPtr) to the first 4
bytes in data ?

Thanks.
 
BitConverter.GetBytes(this.Hwnd.ToInt32()).CopyTo(data, 0);
 

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

Back
Top