GeekFactory

int128.hatenablog.com

.NET

C#からWin32 APIをコールする方法

アクティブなウィンドウのタイトルを取得する例を考えよう。 クラス内に以下の宣言を追加する: [DllImport("user32.dll")] private static extern IntPtr GetForegroundWindow(); [DllImport("user32.dll")] private static extern int GetWindowText(IntPt…