I want to copy the ListView text in other application(an Anti-Virus softeware) to my ListView in my application.

Would you care to elaborate why?
Posted on 2004-04-28 07:58:30 by f0dder


Would you care to elaborate why?


Yes, I do.

I want to use this program to release my work.
Posted on 2004-04-28 18:59:04 by purpleendurer
Afternoon, purpleendurer.

You want to use an anti-virus application to release your work?

Would you please inform us as to what you program is for and what it is meant to do?

Cheers,
Scronty
Posted on 2004-04-28 19:44:03 by Scronty

Afternoon, purpleendurer.

You want to use an anti-virus application to release your work?

Would you please inform us as to what you program is for and what it is meant to do?

Cheers,
Scronty


Hi Scronty

I consider that the functions of the anti-virus application are imperfect, so I want to use my application to advance it.

Cheers,
purpleendurer



If I want to copy the ListView text in other application Under win 95/98,
Can I use mem map file?
Posted on 2004-04-30 04:54:37 by purpleendurer
Hi all

I had tested it is available that copy listview item in other application to the listview in my application by CreateMemMapFile() under win 95/98/2000, and I think it is available under win xp/2003.
Posted on 2004-05-16 08:42:30 by purpleendurer
Hi purpleendurer

You can also try the following ordinals under Win9x to allocate shared memory between processes. They will allocate memory on the shared heap and you can access the pointers returned from any application. They are exported from COMCTL32.DLL. These functions will not work under NT or any new versions of the OS, they are safe for 9x because COMCTL32.DLL is no longer redistributable (ie for 9x it will no longer be upgraded) so there is no danger that they will be replaced in the target OS versions.

invoke Alloc, cb ; Ordinal COMCTL32.DLL:71
Returns pv (pointer to virtual memory)

invoke ReAlloc, pv, cb ; Ordinal COMCTL32.DLL:72
Returns pv (pointer to virtual memory)

invoke Free, pv ; Ordinal COMCTL32.DLL:73
Returns Non-zero

invoke GetSize, pv ; Ordinal COMCTL32.DLL:74
Returns bytes allocated

I have not tried these functions yet, as I have not gotten this far in the settlement API but according to MS it is what is used to pass information between processes in for example WM_GETTEXT.
Posted on 2004-05-16 09:14:51 by donkey
Here is the Desktop listview example rewritten for Win9x using the ordinals. I tested it under 95 OSR0, 98SE, NT4 and Win2K, it works fine. It will distiguish which proc to use based on the OS platform.
Posted on 2004-05-16 09:51:59 by donkey
Thanks Donkey....

You are very nice...:alright:

I has test my code under another computer that OS is also window 2000 pro.

But my code can not copy the listview text and the target application auto terminated :mad:
Posted on 2004-05-17 10:49:57 by purpleendurer
Hi,

Probably a bad pointer. You have to set up the memory to point to an area inside the target application by swapping out the pszText member of the structure with the address of the newly created text buffer in the target process. When you are done you have to reset it to the pointer in your application. Windows NT/2K/XP are much more particular about buffers, especially overflows and bad pointers which is what I suspect happened to yours.
Posted on 2004-05-17 11:00:47 by donkey
Hi Donkey and other friends,

I has uploaded my code.

In my code, I Create a mem map file by calling the CreateMemMapFile(), and use the mem map file as shared memory between processes.

My code has 2 questions:

1. It can copy listview item in other application to the listview in my application under win 98, but it can not copy the listview item and caused the target application auto terminated under win 2000 pro now.
(It worked normally under win 2000 pro the day before yesterday! I forgot where I changed!:()

2. the height of dialog in rsrc.rc must large than 170, else my code will cause a error when close it.


I can not find where is the bad code, Can you help me?

Thanks.



I am testing my code today, and I find:

1. My code can copy file list (it is a listview control) item in MyComputer under win 2000 pro, but when the target listview in the OpenDialog or other application, then my code can not copy the listview item and caused the target application auto terminated....

2. If my code assembled under windows 2000, then my code do not need to call InitCommonControls() and can runs under windows 98 and 2000.

But if my code assembled under windows 98, than my must need to call InitCommonControls(), else my code can not run under windows 98.


I upload my code again.

It assembled with MASM v8 under windows 98, includes:

test.asm
rsrc.rc
test.exe (new)
Posted on 2004-05-19 10:39:56 by purpleendurer