Ejemplo n.º 1
0
        public static object GetProcessIDForegroundWindow(params object[] ps)
        {
            int id = -1;

            Meths.GetWindowThreadProcessId(Meths.GetForegroundWindow(), ref id);
            return(id);
        }
Ejemplo n.º 2
0
        public static object DesktopIsActive(params object[] ps)
        {
            const int     maxChars  = 256;
            IntPtr        handle    = IntPtr.Zero;
            StringBuilder className = new StringBuilder(maxChars);

            handle = Meths.GetForegroundWindow();

            if (Meths.GetClassName(handle, className, maxChars) > 0)
            {
                string cName = className.ToString();
                if (cName == "Progman" || cName == "WorkerW")
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            return(false);
        }
Ejemplo n.º 3
0
 public static object GetForegroundWindow(params object[] ps)
 {
     return(Meths.GetForegroundWindow());
 }