External Program ListBox read
I'm trying to write a program which will be able to read a list box in an external program using WinAPI.
I'm using sendMessage function:
public static extern IntPtr SendMessage(HandleRef hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
and want to send the LB_GETTEXT message to the window of the exernal program.
A few questions:
1. How can I get the handler for the external window needed for the "hWnd" variable? I tried to use the "FindWindow" function, but it returns an integer but I need HandleRef.
2. Did anyone write something like that before and could be so kind to paste his code for reference?

