Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 549631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:12:15+00:00 2026-05-13T11:12:15+00:00

I’d like to read the contents of another process listview control in windows mobile.

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:12:16+00:00Added an answer on May 13, 2026 at 11:12 am

    Well, after a lot of search, I believe that I found a working solution. I am not saying that the solution works perfect or works 100% of the time, however I believe that it is the best that can be done with the memory tools that Windows Mobile provides us.

    Here’s a rough description of the method (if people needed, I can provide full source code):
    a) Use CreateToolhelp32Snapshot to get information from all running processes

    CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS |  TH32CS_SNAPNOHEAPS , 0 );
    

    b) Walk through these processes until you find the one with the listview. You’ll have a PROCESSENTRY32 structure for that proccess, let’s call it pe32.

    PROCESSENTRY32 pe32;
    if( !Process32First( hProcessSnap, &pe32 ) ) 
    ...
    do { ... }
    while( Process32Next( hProcessSnap, &pe32 ) );
    

    c) Use OpenProcess to get a handle for that process, let’s call it hProcess.

    HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID );
    

    d) Starting from pe32.th32MemoryBase+512 until pe32.th32MemoryBase + 0x02000000 (processses in windows mobile 6 have 32 mb memory space) use the VirtualQuery method to receive information about that region. You’ll get a MEMORY_BASIC_INFORMATION structure, let’s call it mbi. Memory regions will be incremented by mbi.RegionSize

    DWORD dwAddress = pe32.th32MemoryBase + 512;
    DWORD dwStopAddress = pe32.th32MemoryBase + 0x02000000; 
    while (VirtualQuery((LPVOID)dwAddress, &mbi, sizeof(mbi))) {
     ...
      dwAddress += mbi.RegionSize;
      if (dwAddress >= dwStopAddress) break;
    }
    

    e) Check to see if mbi.State == MEM_COMMIT and mbi.Protect == PAGE_READWRITE. If both are true, then you can write to that area. Also, take a look at mbi.RegionSize to see if the memory region is enough for your data. If condition are not met, will to next region. WARNING: You do not know on what you will write. You may break the listview application. More on this later.

    if(mbi.State == MEM_COMMIT && mbi.Protect == PAGE_READWRITE ) { ... }
    

    f) Inside the previous if (all conditions met): Declare a pointer that will point to mbi.BaseAddress – pe32.th32MemoryBase:

    char * membase2 = (char *)mbi.BaseAddress - pe32.th32MemoryBase ;

    g) Now you may read or write the memory of the other process using ReadProcessMemory and WriteProcessMemory! For instance, here’s my code for reading the contents of the listview:

    LVITEM lvi, *_lvi;
    LPWSTR _item;
    TCHAR item[128];
    
    _lvi = (LVITEM *) membase2;
    _item = (LPWSTR)membase2;
    _item += 128;
    
    lvi.iSubItem=1;
    lvi.pszText=_item;
    lvi.iItem = 0;
    lvi.cchTextMax = 64;
    
    WriteProcessMemory(hProcess, _lvi, &lvi, sizeof(LVITEM), NULL);
    SendMessage(listHWND, LVM_GETITEMTEXT, (WPARAM)0, (LPARAM)_lvi);
    ReadProcessMemory(hProcess, _item, item, 128, NULL);
    wprintf(TEXT("%s\n"), item);
    

    h) Final thoughts: The method does work. It has been tested by me. However, you must always take into account the warning I mentioned before: You do not know where you are going to write: The memory you will use commited and you can write to it, however you won’t be sure on what you are writing. Of course, this is the memory of the other application so you’ll only break it. If that doesn’t matter that much, you can the restart it and continue reading its memory! When I tested it, the other application did not crush even once, however it was just closed one or two times. Also, if you cannot get it to work, then try another memory region (step d).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,
I would like to run a str_replace or preg_replace which looks for certain words
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.