public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
public bool Equals(RECT Rectangle) { return Rectangle.Left == Left && Rectangle.Top == Top && Rectangle.Right == Right && Rectangle.Bottom == Bottom; }
public static bool testScreen(string screenName, RECT dimensions) { var scr = Screens[screenName]; foreach (PatternType pix in scr) { int x = pix.x; int y = pix.y; //add offset in window to window's location on screen Color sample = Win32.GetPixelColor(dimensions.Left + x, dimensions.Top + y); #if DEBUG Base.Write("Test: " + screenName + "@" + x + "x" + y + " : " + pix.pixelColor.ToString() + " v " + sample.ToString()); #endif if (sample != pix.pixelColor) { #if DEBUG Base.Write("No Match"); #endif return false; } } #if DEBUG Base.Write("Match"); #endif return true; }
public static global::System.Drawing.Rectangle ToRectangle(RECT Rectangle) { return Rectangle.ToRectangle(); }