N
Nick
Hi there,
I'm trying to send a string to another window using SendMessage,
unfortunately I'm not having much luck turning the pointer back into a
string, this is what I'm currently doing,
'//Window sending the message
'//iData is a Char array
Dim pIPrData As IntPtr = Marshal.AllocHGlobal(iData.Length)
Call Marshal.Copy(iData, 0, pIPrData, iData.Length)
SendMessage(pIntHandle, iMsg, pIPrData, iData.Length)
'//In the WndProc method of the window recieving the message
Dim pChrMessage() As Char
Call Marshal.Copy(m.WParam, pChrMessage, 0, m.LParam.ToInt32)
Dim pStrMessage As New String(pChrMessage)
Call MessageBox.Show("Message = " & pStrMessage)
The length is being recieved correctly but I'm still not able to copy
the data into the char array. Any help on this would be greatly
appreciated!
I'm trying to send a string to another window using SendMessage,
unfortunately I'm not having much luck turning the pointer back into a
string, this is what I'm currently doing,
'//Window sending the message
'//iData is a Char array
Dim pIPrData As IntPtr = Marshal.AllocHGlobal(iData.Length)
Call Marshal.Copy(iData, 0, pIPrData, iData.Length)
SendMessage(pIntHandle, iMsg, pIPrData, iData.Length)
'//In the WndProc method of the window recieving the message
Dim pChrMessage() As Char
Call Marshal.Copy(m.WParam, pChrMessage, 0, m.LParam.ToInt32)
Dim pStrMessage As New String(pChrMessage)
Call MessageBox.Show("Message = " & pStrMessage)
The length is being recieved correctly but I'm still not able to copy
the data into the char array. Any help on this would be greatly
appreciated!