//private void mouseHover(object sender, EventArgs e) //{ // //POINT cusorPoint; // //bool ret = GetCursorPos(out cusorPoint); // //IntPtr winHandle = WindowFromPoint(cusorPoint); // //currentHandle = winHandle; // //Console.WriteLine(currentHandle.ToString()); //} private void mouseMove(object sender, EventArgs e) { Point mousePoint = Control.MousePosition; x = mousePoint.X; y = mousePoint.Y; for (int i = 0; i < tempParseArr.Count; i++) { if (leftButtonState == true) { if (x > tempParseArr[i].getBotX()*resoRatioX - 80 && y > tempParseArr[i].getBotY()*resoRatioY - 80 && x < tempParseArr[i].getBotX()*resoRatioX && y < tempParseArr[i].getBotY()*resoRatioY) { curTempParse = tempParseArr[i]; location = true; Console.WriteLine("location true"); break; } else { location = false; Console.WriteLine("location false"); } } } }
private void WindowInPos(object sender, ElapsedEventArgs e) { // const short SWP_NOSIZE = 1; // const short SWP_NOMOVE = 0x2; //const short SWP_NOZORDER = 0x4; //const int SWP_SHOWWINDOW = 0x0040; //Process[] processes = Process.GetProcesses(); //foreach (var process in processes) //{ //Console.WriteLine( process.ProcessName); //handle = process.MainWindowHandle; for (int i = 0; i < tempParseArr.Count; i++) { if (leftButtonState == true) { if (x > tempParseArr[i].getBotX()*resoRatioX - 80 && y > tempParseArr[i].getBotY()*resoRatioY - 80 && x < tempParseArr[i].getBotX()*resoRatioX && y < tempParseArr[i].getBotY()*resoRatioY) { curTempParse = tempParseArr[i]; Console.WriteLine("Location is true"); //SetWindowPos(handle, 0, tempParseArr[i].getTopX() * 3, tempParseArr[i].getTopY() * 3, tempParseArr[i].getBotX() * 3 // - tempParseArr[i].getTopX() * 3, tempParseArr[i].getBotY() * 3 - tempParseArr[i].getTopY() * 3, // SWP_NOZORDER | SWP_SHOWWINDOW); location = true; //makePlexiOverlay(tempParseArr[i], handle); } //else //{ // location = false; //} } //} } }
/** Hold on with this until you fix the mouse hook issues */ private void makePlexiOverlay(TemplateParse tempParse, IntPtr handle) { //nsole.WriteLine("HERHERHE"); //bTimer.AutoReset = false; //bTimer.Enabled = false; //const short SWP_NOZORDER = 0x4; //const int SWP_SHOWWINDOW = 0x0040; //overlayPlexBX = tempParse.getBotX() * 3; //overlayPlexBY = tempParse.getBotY() * 3; //overlayPlexTX = tempParse.getTopX() * 3; //overlayPlexTY = tempParse.getTopY() * 3; //overlayPlex = new Plexiglass(overlayPlexBX - 300, overlayPlexBY - 300, 0, 0); //plexiTimer.AutoReset = true; //plexiTimer.Enabled = true; //while(i != tempParse.getTopX() && j != tempParse.getTopY()) //{ //} //for(int i = temp) //throw new NotImplementedException(); }