views:

392

answers:

2

I'd like to read the contents of another process listview control in windows mobile. To do this, I need a pointer to some free memory to that process in order to put the values there (and then read them from my process). This can be done in normal Windows or Win32 with the VirtualAllocEx function.

However, this function is not supported in windows mobile ! Can you recommend me a way to allocate that memory?

A: 

Shared memory communication is not supported on Windows CE 5 devices.

If you want to communicate between two processes, you have some options. Maybe the best (and easiest) option is to use a local socket, see this thread:

http://stackoverflow.com/questions/200225/easy-ipc-on-windows-mobile

He's not asking about IPC, he wants to read window text from another process. A socket is completely non helpful for this.
ctacke
My suggestion is an alternative to shared memory communication, which is not supported on Windows CE 5. I definitely read his question as an attempt at IPC (reading content from a listview in another process) but I may be misunderstanding something?
The catch is that I cannot modify the proc with the listview, that's why the other process needs to do all the work.
Serafeim
@SerafeimWhat do you mean by "put the values there and then read them from my process"? Why would you put some values and then read them back?
MannyNS
There are two processes: One having the listview (PROCA) and the other that wants to read the contents of the listview (PROCB). I cannot modify PROCA, only PROCB. So, I want to send a message to PROCA to copy the contents of the list to some memory which can be accessed from both PROCA and PROCB and then read this from PROCB. I hope the description is better now !
Serafeim
+1  A: 
Serafeim
This will fail miserably under CE 6.0, so presumably the next version of WinMo will break your code. Bad, bad idea. Why not use a real form of IPC instead of this unsafe hack?
ctacke
Because that's the only way to do it ! I know that CE 6 uses a very different memory model and there functions like VirtualAllocEx can be used in order to do what I wanted. However, VirtualAllocEx cannot be used in Windows Mobile 6, so allocating memory in another proc is not possible there. Using normal IPC is not an option since I cannot modify the listview application, I don't have its source code - so a hack is the only way to go...
Serafeim