私はこのコードを得ました:
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);
}
しかし、OpenOffice.org で Book1 を開いていることがあります。私の質問は、どうすれば異なるウィンドウ タイトルを SW_HIDE できるのでしょうか?
Microsoft Excel - Book1 タイトルが存在する場合
Book1 - OpenOffice.org Calc タイトルが存在する場合
Windowsのタイトル部分「Book1」を見つけることができるかもしれません
どうもありがとうございました!