Example #1
0
        static void Main(string[] args)
        {
            CallBackPtr callBackPtr = new CallBackPtr(EnumReport.Report);

            EnumReport.EnumWindows(callBackPtr, 0);
            EnumReport.PrintDict();
        }
Example #2
0
	public void CreateAccount(string id, string password, CallBackPtr func = null,
							  int score = 0, int soft_cash = 0, int hard_cash = 0, 
							  int equipment = 0, int item = 0, 
							  int buying_equipment_body = 0, int buying_equipment_eye = 0,
							  int buying_equipment_mouth = 0, int buying_equipment_fin = 0,
							  int hp_lv = 0, //int scale_lv = 0,
							  int speed_lv = 0, int fever_lv = 0,
							  string nick_name = "", int exp_lv = 0, int exp_sub = 0){
		WWWForm form = new WWWForm();
		form.AddField("action", "create");
		form.AddField("id",id);
		form.AddField("password",password);
		
		form.AddField("score",score);
		form.AddField("soft_cash",soft_cash);
		form.AddField("hard_cash",hard_cash);
		form.AddField("equipment",equipment);
		form.AddField("item",item);
		
		form.AddField("buying_equipment_eye", buying_equipment_eye);
		form.AddField("buying_equipment_body", buying_equipment_body);
		form.AddField("buying_equipment_mouth", buying_equipment_mouth);
		form.AddField("buying_equipment_fin", buying_equipment_fin);
		
		form.AddField("hp_lv", hp_lv);
		//form.AddField("scale_lv", scale_lv);
		form.AddField("speed_lv", speed_lv);
		form.AddField("fever_lv", fever_lv);
		
		form.AddField("nick_name", nick_name);
		form.AddField("exp_lv", exp_lv);
		form.AddField("exp_sub", exp_sub);
		StartCoroutine(WaitingForResponse(new WWW(URL, form), func));
		form = null;
	}
Example #3
0
	public static IEnumerator DoTransparency(tk2dSprite[] sprite, float time, CallBackPtr callbackPtr = null){
		Color orinColor = new Color(1, 1, 1, 0);//sprite.color;
		Color targetColor = new Color(1, 1, 1, 1);
		Color curSrcColor;
		Color curTargetColor;
		int reverseCount = 16 * (int)time;
		for(int i = 0; i < reverseCount; i++){
			if((i & 1) == 0){
				curSrcColor = new Color(orinColor.r, orinColor.g, orinColor.b, orinColor.a);
				curTargetColor = new Color(targetColor.r, targetColor.g, targetColor.b, targetColor.a);
			}
			else{
				curSrcColor = new Color(targetColor.r, targetColor.g, targetColor.b, targetColor.a);
				curTargetColor = new Color(orinColor.r, orinColor.g, orinColor.b, orinColor.a);
			}
			for(float t = 0; t < time / reverseCount; t += tk2dUITime.deltaTime){
				float nt = Mathf.Clamp01( t / (time / reverseCount) );
				nt = Mathf.Sin(nt * Mathf.PI * 0.5f);
				for(int j = 0; j < sprite.Length; j++)
					sprite[j].color = Color.Lerp(curSrcColor, curTargetColor, nt);
				yield return 0;
			}
		}
		for(int j = 0; j < sprite.Length; j++)
			sprite[j].color = targetColor;//Color.Lerp(curSrcColor, curTargetColor, nt);
		if(callbackPtr != null)
			callbackPtr();
	}
Example #4
0
	public static IEnumerator ScaledUp(Transform trans, float time, Vector3 targetScale, CallBackPtr callbackPtr = null){
		Vector3 orinScale = trans.localScale;
		Vector3 curSrcScale = new Vector3(orinScale.x, orinScale.y, orinScale.z);
		Vector3 curTargetScale = new Vector3(orinScale.x, orinScale.y, orinScale.z);
		int reverseCount = 16; //* (int)time;
		float xRate = (orinScale.x / targetScale.x) / (reverseCount * 2);
		float yRate = (orinScale.y / targetScale.y) / (reverseCount * 2);
		for(int i = 0; i < reverseCount; i++){
			if((i & 1) == 0){
				curSrcScale = new Vector3(orinScale.x + targetScale.x * i * xRate, orinScale.y + targetScale.y * i * yRate, orinScale.z);
				curTargetScale = new Vector3(curSrcScale.x + targetScale.x * i * xRate, curSrcScale.y + targetScale.y * i * yRate, targetScale.z);
			}
			else{
				curSrcScale = new Vector3(curTargetScale.x, curTargetScale.y, curTargetScale.z);
				curTargetScale = new Vector3(curSrcScale.x - targetScale.x * xRate, curSrcScale.x, curSrcScale.x - targetScale.y * yRate);
			}
			for(float t = 0; t < time / (reverseCount * 2); t += tk2dUITime.deltaTime){
				float nt = Mathf.Clamp01( t / (time / (reverseCount * 2)) );
				nt = Mathf.Sin(nt * Mathf.PI * 0.5f);
				trans.localScale = Vector3.Lerp(curSrcScale, curTargetScale, nt);
				yield return 0;
			}
		}
		trans.localScale = targetScale;
		if(callbackPtr != null)
			callbackPtr();	
	}
Example #5
0
 private Stack <IntPtr> GetWindows()
 {
     stack       = new Stack <IntPtr>();
     callBackPtr = new CallBackPtr(Report);
     EnumWindows(callBackPtr, 0);
     return(stack);
 }
    /// <summary>
    /// Does a hit test for specified control (is point of control visible to user)
    /// </summary>
    /// <param name="ctrlRect">the rectangle (usually Bounds) of the control</param>
    /// <param name="ctrlHandle">the handle for the control</param>
    /// <param name="p">the point to test (usually MousePosition)</param>
    /// <param name="ExcludeWindow">a control or window to exclude from hit test (means point is visible through this window)</param>
    /// <returns>boolean value indicating if p is visible for ctrlRect</returns>
    public static bool HitTest(Rectangle ctrlRect, IntPtr ctrlHandle, Point p, IntPtr ExcludeWindow)
    {
        // clear results
        enumedwindowPtrs.Clear();
        enumedwindowRects.Clear();
        // Create callback and start enumeration
        callBackPtr = new CallBackPtr(EnumCallBack);
        EnumDesktopWindows(IntPtr.Zero, callBackPtr, 0);
        // Go from last to first window, and substract them from the ctrlRect area
        Region r             = new Region(ctrlRect);
        bool   StartClipping = false;

        for (int i = enumedwindowRects.Count - 1; i >= 0; i--)
        {
            if (StartClipping && enumedwindowPtrs[i] != ExcludeWindow)
            {
                r.Exclude(enumedwindowRects[i]);
            }
            if (enumedwindowPtrs[i] == ctrlHandle)
            {
                StartClipping = true;
            }
        }
        // return boolean indicating if point is visible to clipped (truly visible) window
        return(r.IsVisible(p));
    }
Example #7
0
 public IEnumerable <IntPtr> List()
 {
     list.Clear();
     callBackPtr = new CallBackPtr(Report);
     User32.EnumWindows(callBackPtr, 0);
     return(list);
 }
Example #8
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Process pr = RI();

            if (pr != null)
            {
                pid = pr.Id;
                CallBackPtr callBackPtr = new CallBackPtr(EnumReport.Report);
                EnumReport.EnumWindows(callBackPtr, 0);
                if (win.Count != 0)
                {
                    DisplayWindow(win[0]);
                }
                else if (UnvWin.Count != 0)
                {
                    //MessageBox.Show("Пожалуйста, подождите...", "Енот");
                    foreach (IntPtr item in UnvWin)
                    {
                        if (GetWindowText(item).Contains(Process.GetCurrentProcess().ProcessName))
                        {
                            DisplayWindow(item);
                        }
                    }
                }
            }
            else
            {
                Application.Run(new MainForm(args));
            }
        }
Example #9
0
	public void GetPlayerInfo(string id, CallBackPtr func){
		WWWForm form = new WWWForm();
		form.AddField("action", "getPlayerInfo");
		form.AddField("id", id);
		
		StartCoroutine(WaitingForResponse(new WWW(URL, form), func));
		form = null;
	}
Example #10
0
    public static List <IntPtr> GetWindows()
    {
        mHandles.Clear();
        CallBackPtr callBackPtr = new CallBackPtr(Callback);

        EnumWindows(callBackPtr, IntPtr.Zero);
        return(mHandles);
    }
Example #11
0
        public bool FindThenExecute(CallBackPtr callback)
        {
            u  = this;
            cb = callback;

            EnumWindows(Utils.EnumCallBack, 0);
            return(true);
        }
Example #12
0
	//private string URL = "http://localhost:8080/"; 
	
	public void Login(string id, string password, CallBackPtr func){
		WWWForm form = new WWWForm();
		form.AddField("action", "login");
		form.AddField("id",id);
		form.AddField("password",password);
		StartCoroutine(WaitingForResponse(new WWW(URL, form), func));
		form = null;
	}
Example #13
0
        /// <summary>
        /// Does a hit test for specified control (is point of control visible to user)
        /// </summary>
        /// <param name="ctrlRect">the rectangle (usually Bounds) of the control</param>
        /// <param name="ctrlHandle">the handle for the control</param>
        /// <returns>boolean value indicating if ctrlRect is overlayed by another control </returns>
        public static bool IsOverLayed( Rectangle ctrlRect, IntPtr ctrlHandle )
        {
            // clear results
            enumedwindowPtrs.Clear();
            enumedwindowRects.Clear();

            // Create callback and start enumeration
            callBackPtr = new CallBackPtr( EnumCallBack );
            EnumDesktopWindows( IntPtr.Zero, callBackPtr, 0 );

            // Go from last to first window, and substract them from the ctrlRect area
            Region r = new Region( ctrlRect );

            bool StartClipping = false;
            for( int i = enumedwindowRects.Count - 1; i >= 0; i-- )
            {
                if( StartClipping )
                {
                    r.Exclude( enumedwindowRects[i] );
                }

                if( enumedwindowPtrs[i] == ctrlHandle ) StartClipping = true;
            }

            //Creating a list of points scattered on the edges of the window.
            IList<System.Drawing.Point> pointList = new List<System.Drawing.Point>();
            pointList.Add( new System.Drawing.Point( ctrlRect.X, ctrlRect.Y ) );
            pointList.Add( new System.Drawing.Point( ctrlRect.X + ctrlRect.Width - 2, ctrlRect.Y ) );
            pointList.Add( new System.Drawing.Point( ctrlRect.X + ctrlRect.Width - 2, ctrlRect.Y + ctrlRect.Height - 2 ) );
            pointList.Add( new System.Drawing.Point( ctrlRect.X, ctrlRect.Y + ctrlRect.Height - 2 ) );

            //TODO : choose the scale considering the width and height of the window.
            int scale = 50;
            int xOffset = 0;
            int yOffset = 0;
            int offset = 2;
            for( int x = 0; x <= scale; x++ )
            {
                for( int y = 0; y <= scale; y++ )
                {
                    if( y == scale ) yOffset = offset;
                    else yOffset = 0;

                    if( x == scale ) xOffset = offset;
                    else xOffset = 0;

                    pointList.Add( new System.Drawing.Point( ctrlRect.X + ctrlRect.Width / scale * x - xOffset, ctrlRect.Y + ctrlRect.Height / scale * y - yOffset ) );
                }
            }

            //Checking if theses points are visible by the user
            foreach( var item in pointList )
            {
                if( !r.IsVisible( item ) ) return true;
            }

            return false;
        }
        public static void EnumerateWindows()
        {
            //clear the current list
            _currentList.Clear();

            if (true)
            {

                //create callback
                callBackPtr = new CallBackPtr(EnumWindow);

                //enumerate the windows
                var ok = EnumWindows(callBackPtr, 0);

            }
            else
            {
                var processes = Process.GetProcesses();
                foreach (var process in processes)
                {
                    if (process.MainWindowHandle != IntPtr.Zero)
                    {
                        //collect all the windows into a list
                        _currentList.Add(new ProcessItem()
                        {
                            WindowHandle = process.MainWindowHandle.ToInt32(),
                            WindowText = process.MainWindowTitle.ToString(),
                            IsWindowVisible = IsWindowVisible(process.MainWindowHandle)
                        });
                    }
                }
            }

            //compare the current list to the collection

            //find the items in the current list that are not in the collection
            var notInCollection = (from c in _currentList
                                   where !(from w in Windows select w.WindowHandle).Contains(c.WindowHandle)
                                   select c).ToArray();

            //now find the ones in the Window list that are not in the current list
            var notInCurrent = (from w in Windows
                                where !(from c in _currentList select c.WindowHandle).Contains(w.WindowHandle)
                                select w).ToArray();

            //now remove the ones not in current
            foreach (var w in notInCurrent)
            {
                App.Current.Dispatcher.BeginInvoke(new Action(() => { Windows.Remove(w); }));
            }

            //add the ones not in collection
            foreach (var w in notInCollection)
            {
                App.Current.Dispatcher.BeginInvoke(new Action(() => { Windows.Add(w); }));

            }
        }
Example #15
0
        private static void Main(string[] args)
        {
            CallBackPtr point = new CallBackPtr(ProcIntId);

            EnumWindows(point, 0);
            //GetWindowThreadProcessId(point, 0);
            //Console.WriteLine(handles.Count);
            WindowsIds();
        }
Example #16
0
        private void RefreshButtonClick(object sender, EventArgs e)
        {
            _handleList.Clear();
            windowList.Items.Clear();

            _callBackPtr = ListWindows;
            WindowsApi.EnumWindows(_callBackPtr, (IntPtr)0);
            windowList.SelectedIndex = 0;
        }
Example #17
0
 static void Main()
 {
     do
     {
         Console.Clear();
         CallBackPtr callBackPtr = new CallBackPtr(EnumReport.Show);
         EnumReport.EnumWindows(callBackPtr, 0);
         Console.WriteLine("\n\nPress Enter to refresh results or any button to exit");
     } while (Console.ReadKey(false).Key == ConsoleKey.Enter);
 }
Example #18
0
    public void Perform()
    {
        Process[] myProcesses;
        myProcesses        = Process.GetProcesses();
        MyFormPoster       = new FormPoster();
        MyConsoleLogger    = new ConsoleLogger();
        MyNTEventLogLogger = new NTEventLogLogger();
        myDiscovery        = new ToolSpecificEvent();

        myDiscovery.ActionEvent += new ToolSpecificEventHandler(MyConsoleLogger.handler);
        myDiscovery.ActionEvent += new ToolSpecificEventHandler(MyNTEventLogLogger.handler);
        myDiscovery.ActionEvent += new ToolSpecificEventHandler(MyFormPoster.handler);
        configuration_from_xml   = new ConfigRead();
        configuration_from_xml.LoadConfiguration("Configuration/ProcessDetection/Process", "ProcessName");
        string process_detector_expression = configuration_from_xml.DetectorExpression;
        Regex  process_detector_regex      = new Regex(process_detector_expression, RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);

        foreach (Process myProcess in myProcesses)
        {
            string res    = String.Empty;
            string sProbe = myProcess.ProcessName;
            //  myProcess.StartInfo.FileName - not accessible
            if (Debug)
            {
                Console.WriteLine("Process scan: {0}", process_detector_expression);
            }
            MatchCollection m = process_detector_regex.Matches(sProbe);
            if (sProbe != null && m.Count != 0)
            {
                try
                {
                    DialogDetected       = true;
                    process_command_line = new ProcessCommandLine(myProcess.Id.ToString());
                    if (Debug)
                    {
                        Console.WriteLine("{0}{1}", myProcess.Id.ToString(), process_command_line.CommandLine);
                    }
                    CommandLine = process_command_line.CommandLine;
                    // CommandLine = myProcess.ProcessName;
                    Console.WriteLine("--> {0} {1} {2} {3}", sProbe, myProcess.ProcessName, myProcess.Id, DateTime.Now - myProcess.StartTime);
                }
                catch (Win32Exception e) {
                    System.Diagnostics.Trace.Assert(e != null);
                }
            }
        }
        CallBackPtr callBackPtr = new CallBackPtr(EnumReport.Report);

        if (DialogDetected)
        {
            EnumReport.evt         = myDiscovery;
            EnumReport.CommandLine = CommandLine;
            EnumReport.EnumWindows(callBackPtr, 0);
        }
    }
Example #19
0
	public static IEnumerator TransformAToB(Transform trans, float time, Vector3 targetPos, CallBackPtr callbackPtr){
		Vector3 orinPos = trans.localPosition;
        for(float t = 0; t < time; t += tk2dUITime.deltaTime){
            float nt = Mathf.Clamp01( t / time );
			nt = Mathf.Sin(nt * Mathf.PI * 0.5f);
			trans.localPosition = Vector3.Lerp(orinPos, targetPos, nt);
          	yield return 0;
        }
		trans.localPosition = targetPos;
		callbackPtr();
	}
Example #20
0
        public static List <WindowSpec> ListWindows()
        {
            WindowNames = new List <WindowSpec>();

            CallBackPtr callBackPtr;

            callBackPtr = new CallBackPtr(Report);
            EnumWindows(callBackPtr, 0);

            return(WindowNames);
        }
Example #21
0
        public static List<WindowSpec> ListWindows()
        {
            WindowNames = new List<WindowSpec>();

            CallBackPtr callBackPtr;

            callBackPtr = new CallBackPtr(Report);
            EnumWindows(callBackPtr, 0);

            return WindowNames;
        }
Example #22
0
        public void Move(MovementDirection md)
        {
            // note in other situations, it is important to keep
            // callBackPtr as a member variable so it doesnt GC while you're calling EnumWindows

            callBackPtr = new CallBackPtr(Movement.Report);
            var data = new ReportData();

            data.md    = md;
            data.debug = debug;
            Movement.EnumWindows(callBackPtr, ref data);
        }
Example #23
0
	public static IEnumerator LerpColorAToB(tk2dSprite sprite, float time, Color targetColor, CallBackPtr callbackPtr = null){
		Color orinColor = sprite.color;
		for(float t = 0; t < time; t += tk2dUITime.deltaTime){
			float nt = Mathf.Clamp01( t / time );
			nt = Mathf.Sin(nt * Mathf.PI * 0.5f);
			sprite.color = Color.Lerp(orinColor, targetColor, nt);
			yield return 0;
		}
		sprite.color = targetColor;
		if(callbackPtr != null)
			callbackPtr();
	}
Example #24
0
	public static IEnumerator Roatate(Transform trans, float time, Vector3 targetRoatate, CallBackPtr callbackPtr = null){
		Vector3 orinRotate = trans.localEulerAngles;
		for(float t = 0; t < time; t += tk2dUITime.deltaTime){
			float nt = Mathf.Clamp01( t / time );
			nt = Mathf.Sin(nt * Mathf.PI * 0.5f);
			trans.localEulerAngles = Vector3.Lerp(orinRotate, targetRoatate, nt);
			//Debug.Log(trans.localEulerAngles);
			yield return 0;
		}
		trans.localEulerAngles = targetRoatate;
		if(callbackPtr != null)
			callbackPtr();
	}
Example #25
0
	public static IEnumerator Obstacle_BreakUp(Transform trans, float time, Vector3 targetRoatate, CallBackPtr callbackPtr = null){
		Vector3 orinRotate = trans.localEulerAngles;
		for(float t = 0; t < time; t += tk2dUITime.deltaTime){
			float nt = Mathf.Clamp01( t / time );
			nt = Mathf.Sin(nt * Mathf.PI * 0.5f);
			trans.localPosition -= new Vector3(-1, -2, 0);
			trans.localEulerAngles = Vector3.Lerp(orinRotate, targetRoatate, nt);
			trans.localPosition += new Vector3(1, 2, 0);
			yield return 0;
		}
		trans.localEulerAngles = targetRoatate;
		if(callbackPtr != null)
			callbackPtr();
	}
    public void Perform()
    {
        Process[] myProcesses;
        myProcesses = Process.GetProcesses();
        MyFormPoster = new FormPoster();
        MyConsoleLogger = new ConsoleLogger();
        MyNTEventLogLogger = new NTEventLogLogger();
        myDiscovery = new ToolSpecificEvent();

        myDiscovery.ActionEvent += new ToolSpecificEventHandler(MyConsoleLogger.handler);
        myDiscovery.ActionEvent += new ToolSpecificEventHandler(MyNTEventLogLogger.handler);
        myDiscovery.ActionEvent += new ToolSpecificEventHandler(MyFormPoster.handler);
        configuration_from_xml = new ConfigRead();
        configuration_from_xml.LoadConfiguration("Configuration/ProcessDetection/Process", "ProcessName");
        string process_detector_expression = configuration_from_xml.DetectorExpression;
        Regex process_detector_regex = new Regex(process_detector_expression, RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);

        foreach (Process myProcess in myProcesses)
        {
            string res = String.Empty;
            string sProbe = myProcess.ProcessName;
            //  myProcess.StartInfo.FileName - not accessible
            if (Debug) Console.WriteLine("Process scan: {0}", process_detector_expression); MatchCollection m = process_detector_regex.Matches(sProbe);
            if (sProbe != null && m.Count != 0)
            {
                try
                {
                    DialogDetected = true;
                    process_command_line = new ProcessCommandLine(myProcess.Id.ToString());
                    if (Debug) Console.WriteLine("{0}{1}", myProcess.Id.ToString(), process_command_line.CommandLine);
                    CommandLine = process_command_line.CommandLine;
                    // CommandLine = myProcess.ProcessName;
                    Console.WriteLine("--> {0} {1} {2} {3}", sProbe, myProcess.ProcessName, myProcess.Id, DateTime.Now - myProcess.StartTime);
                }
                catch (Win32Exception e) {
                     System.Diagnostics.Trace.Assert(e != null);
                }
            }
        }
        CallBackPtr callBackPtr = new CallBackPtr(EnumReport.Report);
        if (DialogDetected)
        {
            EnumReport.evt = myDiscovery;
            EnumReport.CommandLine = CommandLine;
            EnumReport.EnumWindows(callBackPtr, 0);
        }
    }
Example #27
0
        public static IEnumerable <IntPtr> FindWindows(IntPtr parentHWnd, CallBackPtr filter)
        {
            IntPtr        found   = IntPtr.Zero;
            List <IntPtr> windows = new List <IntPtr>();

            EnumWindows(delegate(IntPtr hWnd, IntPtr lParam)
            {
                // Only add windows that pass through the filter
                if (filter(hWnd, lParam))
                {
                    windows.Add(hWnd);
                }

                return(true);
            }, parentHWnd);

            return(windows);
        }
Example #28
0
        public bool ValidateGrayboxInstallation()
        {
            callBackPtr = new CallBackPtr(Report);
            EnumWindows(callBackPtr, 0);

            debug("Checking Graybox installation ... ");

            if (m_bGrayBoxRunning == false)
            {
                //Finding Graybox path
                debug(" Graybox instance ... ");

                string grayboxpath = GetGrayboxPath();
                if (grayboxpath == null)
                {
                    debug("Graybox not installed");
                    debug("Please verify Graybox installation");
                    return(false);
                }
                else
                {
                    debug("Starting Graybox ...");
                    grayboxpath = grayboxpath + "\\Graybox.exe";
                    Process prcsGrayBox = new Process();
                    prcsGrayBox.StartInfo.FileName = grayboxpath;
                    prcsGrayBox.Start();
                    debug("Please login to graybox and reconnect again. Connection aborted.");
                    return(false);
                }
                //return false;

                //MessageBox.Show("Please start Graybox before connecting. Connection aborted. Reconnect again");
                //return false;
            }

            return(true);
        }
Example #29
0
 private static extern int EnumWindows(CallBackPtr callPtr, int lPar);
Example #30
0
 /*********************************************************************
 * Returns a list of all of the windows that pass through the filter *
 *********************************************************************/
 public static IEnumerable <IntPtr> FindWindows(CallBackPtr filter)
 {
     return(FindWindows(IntPtr.Zero, filter));
 }
Example #31
0
 public static extern bool EnumChildWindows(IntPtr hWndParent, CallBackPtr callPtr, IntPtr lParam);
Example #32
0
 public static extern int EnumWindows(CallBackPtr lpfn, int lParam);
Example #33
0
 public static extern int EnumWindows(CallBackPtr callPtr, int lPar);
Example #34
0
File: api.cs Project: zapu/Algenhax
 public static extern bool EnumChildWindows(IntPtr parentHandle, CallBackPtr callback, int lParam);
Example #35
0
        public bool FindThenExecute(CallBackPtr callback)
        {
            u = this;
            cb = callback;

            EnumWindows(Utils.EnumCallBack, 0);
            return true;
        }
Example #36
0
 private static extern int EnumWindows(CallBackPtr callPtr, int lPar);
Example #37
0
        public bool ValidateGrayboxInstallation()
        {
                callBackPtr = new CallBackPtr(Report);
                EnumWindows(callBackPtr, 0);

                debug("Checking Graybox installation ... ");

                if (m_bGrayBoxRunning == false)
                {
                    //Finding Graybox path
                    debug(" Graybox instance ... ");

                    string grayboxpath = GetGrayboxPath();
                    if (grayboxpath == null)
                    {
                        debug("Graybox not installed");
                        debug("Please verify Graybox installation");
                        return false;
                    }
                    else
                    {
                        debug("Starting Graybox ...");
                        grayboxpath =  grayboxpath + "\\Graybox.exe";
                        Process prcsGrayBox = new Process();
                        prcsGrayBox.StartInfo.FileName = grayboxpath;
                        prcsGrayBox.Start();
                        debug("Please login to graybox and reconnect again. Connection aborted.");
                        return false;
                    }
                    //return false;
                    
                    //MessageBox.Show("Please start Graybox before connecting. Connection aborted. Reconnect again");
                    //return false;
                }

                return true;
        }
Example #38
0
 public static extern bool EnumChildWindows(IntPtr parentHandle, CallBackPtr callback, int lParam);
Example #39
0
 public static extern bool EnumWindows(CallBackPtr callPtr, IntPtr lParam);
Example #40
0
 public static extern int EnumChildWindows(IntPtr hWnd, CallBackPtr callPtr, int lPar);
Example #41
0
 static extern bool EnumWindows(CallBackPtr lpEnumFunc, IntPtr lParam);
Example #42
0
 public static void KickOffEnumWindows()
 {
     callBackPtr = new CallBackPtr(GetWindowHandle);
     mAvailableWins.Clear();
     EnumWindows(callBackPtr, IntPtr.Zero);
 }
Example #43
0
	public void UpdateAccount(string id, CallBackPtr func = null, 
							  int score = INTEGER_NULL, int soft_cash = INTEGER_NULL, int hard_cash = INTEGER_NULL, 
							  int equipment = INTEGER_NULL, int item = INTEGER_NULL,  
							  int buying_equipment_body = INTEGER_NULL, int buying_equipment_eye = INTEGER_NULL,
							  int buying_equipment_mouth = INTEGER_NULL, int buying_equipment_fin = INTEGER_NULL,
							  int hp_lv = INTEGER_NULL, //int scale_lv = INTEGER_NULL,
							  int speed_lv = INTEGER_NULL, int fever_lv = INTEGER_NULL,
							  string nick_name = STRING_NULL, int exp_lv = INTEGER_NULL, int exp_sub = INTEGER_NULL,
							  string password = STRING_NULL){
		WWWForm form = new WWWForm();
		form.AddField("action", "update");
		form.AddField("id", id);
		
		form.AddField("score",score);
		form.AddField("soft_cash",soft_cash);
		form.AddField("hard_cash",hard_cash);
		form.AddField("equipment",equipment);
		form.AddField("item",item);
		FormAddHelperToString(form, "password", password);
		
		form.AddField("buying_equipment_eye", buying_equipment_eye);
		form.AddField("buying_equipment_body", buying_equipment_body);
		form.AddField("buying_equipment_mouth", buying_equipment_mouth);
		form.AddField("buying_equipment_fin", buying_equipment_fin);
		
		form.AddField("hp_lv", hp_lv);
		//form.AddField("scale_lv", scale_lv);
		form.AddField("speed_lv", speed_lv);
		form.AddField("fever_lv", fever_lv);
		
		FormAddHelperToString(form, "nick_name", nick_name);
		form.AddField("exp_lv", exp_lv);
		form.AddField("exp_sub", exp_sub);
		
		StartCoroutine(WaitingForResponse(new WWW(URL, form), func));
		form = null;
	}
Example #44
0
	public void UpdateAccount_BuyingEquipment(string id, CallBackPtr func = null, 
								int buying_equipment_body = INTEGER_NULL, int buying_equipment_eye = INTEGER_NULL,
							  	int buying_equipment_mouth = INTEGER_NULL, int buying_equipment_fin = INTEGER_NULL){
		UpdateAccount(id, func, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, 
					  buying_equipment_body, buying_equipment_eye, buying_equipment_mouth, buying_equipment_fin);
	}
Example #45
0
 public static extern bool EnumWindows(CallBackPtr callback, IntPtr extraData);
Example #46
0
	public void UpdateAccount_Equipment(string id, CallBackPtr func = null, int equipment = INTEGER_NULL){
		UpdateAccount(id, func, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, equipment);
	}
Example #47
0
	public void UpdateAccount_Item(string id, CallBackPtr func = null, int item = INTEGER_NULL){
		UpdateAccount(id, func, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, item);
	}
Example #48
0
	public void UpdateAccount_Ability(string id, CallBackPtr func = null, 
		int hp_lv = INTEGER_NULL, int speed_lv = INTEGER_NULL, int fever_lv = INTEGER_NULL){
		UpdateAccount(id, func, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, 
			hp_lv, speed_lv, fever_lv);
	}
Example #49
0
        /// <summary>
        /// Does a hit test for specified control (is point of control visible to user)
        /// </summary>
        /// <param name="ctrlRect">the rectangle (usually Bounds) of the control</param>
        /// <param name="ctrlHandle">the handle for the control</param>
        /// <returns>boolean value indicating if ctrlRect is overlayed by another control </returns>
        public static bool IsOverLayed(Rectangle ctrlRect, IntPtr ctrlHandle)
        {
            // clear results
            enumedwindowPtrs.Clear();
            enumedwindowRects.Clear();

            // Create callback and start enumeration
            callBackPtr = new CallBackPtr(EnumCallBack);
            EnumDesktopWindows(IntPtr.Zero, callBackPtr, 0);

            // Go from last to first window, and substract them from the ctrlRect area
            Region r = new Region(ctrlRect);

            bool StartClipping = false;

            for (int i = enumedwindowRects.Count - 1; i >= 0; i--)
            {
                if (StartClipping)
                {
                    r.Exclude(enumedwindowRects[i]);
                }

                if (enumedwindowPtrs[i] == ctrlHandle)
                {
                    StartClipping = true;
                }
            }

            //Creating a list of points scattered on the edges of the window.
            IList <System.Drawing.Point> pointList = new List <System.Drawing.Point>();

            pointList.Add(new System.Drawing.Point(ctrlRect.X, ctrlRect.Y));
            pointList.Add(new System.Drawing.Point(ctrlRect.X + ctrlRect.Width - 2, ctrlRect.Y));
            pointList.Add(new System.Drawing.Point(ctrlRect.X + ctrlRect.Width - 2, ctrlRect.Y + ctrlRect.Height - 2));
            pointList.Add(new System.Drawing.Point(ctrlRect.X, ctrlRect.Y + ctrlRect.Height - 2));

            //TODO : choose the scale considering the width and height of the window.
            int scale   = 50;
            int xOffset = 0;
            int yOffset = 0;
            int offset  = 2;

            for (int x = 0; x <= scale; x++)
            {
                for (int y = 0; y <= scale; y++)
                {
                    if (y == scale)
                    {
                        yOffset = offset;
                    }
                    else
                    {
                        yOffset = 0;
                    }

                    if (x == scale)
                    {
                        xOffset = offset;
                    }
                    else
                    {
                        xOffset = 0;
                    }

                    pointList.Add(new System.Drawing.Point(ctrlRect.X + ctrlRect.Width / scale * x - xOffset, ctrlRect.Y + ctrlRect.Height / scale * y - yOffset));
                }
            }

            //Checking if theses points are visible by the user
            foreach (var item in pointList)
            {
                if (!r.IsVisible(item))
                {
                    return(true);
                }
            }

            return(false);
        }
Example #50
0
	public void UpdateAccount_EXP(string id, CallBackPtr func = null, int exp_lv = INTEGER_NULL, int exp_sub = INTEGER_NULL){
		UpdateAccount(id, func, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL,
					  INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, STRING_NULL, exp_lv, exp_sub);
	}
 private static extern int EnumDesktopWindows(IntPtr hDesktop, CallBackPtr callPtr, int lPar);
Example #52
0
	public void UpdateAccount_NickName(string id, CallBackPtr func = null, string nick_name = STRING_NULL){
		UpdateAccount(id, func, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL,
			INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, INTEGER_NULL, nick_name);
	}
Example #53
0
 public static extern int EnumWindows(CallBackPtr callPtr, int lPar);
Example #54
0
	public void GetRankingList(int count, string id, CallBackPtr func = null){
		WWWForm form = new WWWForm();
		form.AddField("action", "getRankingList");
		form.AddField("id", id);
		form.AddField("count", count);
		StartCoroutine(WaitingForResponse(new WWW(URL, form), func));
		form = null;
	}
Example #55
0
 public static extern int EnumThreadWindows(int dwThreadId, CallBackPtr lpfn, int lParam);
Example #56
0
	public IEnumerator WaitingForResponse(WWW www, CallBackPtr callBackPtr){
		yield return www;
		if(www.error == null){
			//Debug.Log("WWW Link is Successful.");
			//Debug.Log(www.text);
		}
		else
			Debug.Log("WWW Link is Failed.");
		
		if(callBackPtr != null){
			callBackPtr(www.text);
			callBackPtr = null;
		}
		
		www.Dispose();
	}
Example #57
0
 public static extern int EnumChildWindows(IntPtr hWndParent, CallBackPtr lpfn, int lParam);
Example #58
0
 private static extern bool EnumDesktopWindows(IntPtr hDesktop, CallBackPtr lpEnumCallbackFunction, IntPtr lParam);
Example #59
0
 static extern bool EnumWindows(CallBackPtr lpEnumFunc, IntPtr lParam);
Example #60
0
 public static extern bool EnumDesktopWindows(IntPtr hDesktop, CallBackPtr filter, IntPtr lParam);