Thor371
asked on
Listview DELETEALLITEMS
I'm wondeirng how I sendmessage to a listview in another program and delete all its items from my program.
I think i'm suppoed to use SendMessage(handle, lvm_DELETEALLITEMS
Thor371
I think i'm suppoed to use SendMessage(handle, lvm_DELETEALLITEMS
Thor371
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Well, the only thing I can say about your function - you may write at the end of function
result := ListView_FindItem(hdl, -1, plvfi) <> -1;
and 'result := false;' is not needed in this case.
This functions will work only if listview is in the same application with this function. Do you need to work with listviews from external applications?
result := ListView_FindItem(hdl, -1, plvfi) <> -1;
and 'result := false;' is not needed in this case.
This functions will work only if listview is in the same application with this function. Do you need to work with listviews from external applications?
ASKER
Yeah it's an external program, not my process. It's actually an irc client that uses a listview class. The only thing i can think is to inject dll into process or use readprocessmemory to find items. I saw an example in c++ http://dotnetjunkies.com/WebLog/chris.taylor/archive/2004/01/16/5689.aspx maybe thats answer to help me?
Thor371
Thor371
ASKER
You get all the points! If you can help me fix a function I wrote I'll give you another 2000 points
I'll open another thread and award you the points since it is a different question.
Function FindItem(hdl : THandle; Caption : PChar): bool;
var
plvfi: TLVFindInfo;
begin
result := false;
plvfi.flags := LVFI_STRING or LVFI_PARTIAL;
plvfi.psz := Caption;
if ( ListView_FindItem(hdl, -1, plvfi) <> -1 ) then result := true
end;
Thor371