Exemplo n.º 1
0
        public static string GetActiveWindowTitle()
        {
            StringBuilder text = new StringBuilder(256);

            if (WindowHandles.GetWindowText(WindowHandles.GetForegroundWindow(), text, 256) > 0)
            {
                return(text.ToString());
            }
            return((string)null);
        }
Exemplo n.º 2
0
 private void tick()
 {
     try
     {
         uint ProcessId;
         WindowHandles.GetWindowThreadProcessId(WindowHandles.GetForegroundWindow(), out ProcessId);
         using (Process processById = Process.GetProcessById((int)ProcessId))
             base.Value = (object)processById.MainModule.FileName;
     }
     catch (Exception ex)
     {
         base.Unavailable();
     }
 }
Exemplo n.º 3
0
 private void tick()
 {
     try
     {
         uint ProcessId;
         WindowHandles.GetWindowThreadProcessId(WindowHandles.GetForegroundWindow(), out ProcessId);
         using (Process processById = Process.GetProcessById((int)ProcessId))
             base.Value = !processById.Responding ? (object)"INACTIVE" : (object)"ACTIVE";
     }
     catch (Exception ex)
     {
         base.Unavailable();
     }
 }
Exemplo n.º 4
0
 private void tick()
 {
     try
     {
         WindowHandles.Rect lpRect;
         if (WindowHandles.GetWindowRect(WindowHandles.GetForegroundWindow(), out lpRect))
         {
             base.Value = (object)(lpRect.Bottom - lpRect.Top);
         }
         else
         {
             base.Unavailable();
         }
     }
     catch (Exception ex)
     {
         base.Unavailable();
     }
 }