selected item in a list

I'm trying to programmatically select item in a listbox in another program. I figured out the handle to the listbox but I'm having trouble selecting the items in the listbox.

I have tried this so far and this doesnt seem to work. Can anyone help me out w/ whats wrong by fixing my code or proposing a new way to tackle this.
//I'm trying to setselectionmark to 11th item in the list.
SendMessage(tester1,LVM_SETSELECTIONMARK,0,10);

//I believe this doesnt change the state of the item so I tried:

IntPtr pointer1= Marshal.AllocHGlobal(Marshal.SizeOf(typeof(LV_ITEM)));
Marshal.StructureToPtr(lvItem,pointer1,true);
lvItem.stateMask=LVIS_SELECTED | LVIS_FOCUSED;
SendMessage(tester1,LVM_SETITEMSTATE,10,pointer1);
Marshal.FreeHGlobal(pointer1);

[830 byte] By [C#newbie] at [2008-2-15]
# 1
This is not the answer you want...If you have access to the code of the other program, put in a hook into the program which will do what you need. Using something like remoting to accomplish what you need.

Otherwise...maybe simulate a mouse click, since your code seemed to suggest this is a test situation. I do not have a code example, but it might be worth investigating.

OmegaMan at 2007-9-7 > top of Msdn Tech,Windows Forms,Windows Forms General...