I got this code:
using System.Runtime.InteropServices;
[DllImportAttribute("User32.dll")]
private static extern int FindWindow(String ClassName, String WindowName);
[DllImport("User32")]
private static extern int ShowWindow(int hWnd, int nCmdShow);
private const int SW_HIDE = 0;
int hWnd = FindWindow(null, Microsoft Excel - Book1);
if (hWnd > 0)
{
ShowWindow(hWnd, SW_HIDE);
}
But sometimes im oppening Book1 with OpenOffice.org.. and my question is, how can i SW_HIDE different windows titles?
If Microsoft Excel - Book1 title exists
If Book1 - OpenOffice.org Calc title exists
Maybe it is possible to find windows title part "Book1"
Thank you very much!