[DllImport("user32.dll")] static extern IntPtr GetForegroundWindow(); const int nChars = 256; IntPtr handle = IntPtr.Zero; StringBuilder Buff = new StringBuilder(nChars); handle = GetForegroundWindow(); if (GetWindowText(handle, Buff, nChars) > 0) { Log.WriteLine(Buff.ToString()); return Buff.ToString(); } Log.WriteLine("Returning Null"); return null;
GetForegroundWindow
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)