Example #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);
        }
Example #2
0
 private void tick()
 {
     try
     {
         base.Value = !WindowHandles.GetAsyncKeyState((ushort)2) ? (object)"INACTIVE" : (object)"ACTIVE";
     }
     catch (Exception ex)
     {
         base.Unavailable();
     }
 }
Example #3
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();
     }
 }
 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();
     }
 }
 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();
     }
 }
Example #6
0
 private void tick()
 {
     try
     {
         Point lpPoint;
         if (WindowHandles.GetCursorPos(out lpPoint))
         {
             base.Value = (object)lpPoint.X;
         }
         else
         {
             base.Unavailable();
         }
     }
     catch (Exception ex)
     {
         base.Unavailable();
     }
 }
Example #7
0
 private void tick()
 {
     try
     {
         string activeWindowTitle = WindowHandles.GetActiveWindowTitle();
         if (!string.IsNullOrEmpty(activeWindowTitle))
         {
             base.Value = (object)activeWindowTitle;
         }
         else
         {
             base.Unavailable();
         }
     }
     catch (Exception ex)
     {
         base.Unavailable();
     }
 }