性格悪い人が優勝

こんにちは、C#で、Windows標準の電卓が起動してるか調べるにはどのように記述したら良いのでしょうか?

プログラミングは素人ですが、ヒントだけでも教えていただけると助かります。

環境:Windows2000 SP3
Microsoft Visual Studio .NET Professional

どうかよろしくお願いします。

A 回答 (1件)

上手く行くかどうか分かりませんが、以下を試してみてください。



int hwnd = FindWindow("Calc", null);
if (hwnd > 0)
{
// 電卓が起動している
}
else
{
// 電卓は起動していない
}
    • good
    • 0
この回答へのお礼

digitalsupportさん、ありがとうございました。

上手くいきました。
UME3

using System.Runtime.InteropServices;
public class MyApi
{
[DllImport("user32.dll")]
public static extern int FindWindow(string strclassName, string strWindowName);
};
int hwnd = MyApi.FindWindow( null,"電卓");
if (hwnd > 0)
{
// 電卓が起動している
}
else
{
// 電卓は起動していない
}

お礼日時:2003/01/21 15:56

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!