You need to call ShowWindowAsync.
Use the following signature:
[DllImport("user32.dll")]
public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
Ad your double click hadler should look like this:
private void ListBox1_DoubleClick(object sender, EventArgs e)
{
if (listBox1.SelectedItem != null)
{
const int SW_RESTORE = 9;
string selected = listBox1.SelectedItem.ToString();
IntPtr handleOfSelected = getHandle(selected);
ShowWindowAsync(handleOfSelected, SW_RESTORE);
SetForegroundWindow(handleOfSelected);
}
}