Hello All,
I am trying to monitor a third party application that is not supported anymore.
I currently have a process in a timer thats been set as SetTimer(1,1,NULL) that monitors a pixel as to when it changes color. Using the timer I have been able to capture 95 - 97% of the changes.
This is what I am using in the timer function:
static int Count=0;
CString Test;
HWND Monitoring_App = FindWindow(ClassName,NULL);
HDC hDC = GetDC(Monitoring_App);
COLORREF Color2Test = GetPixel(hDC,x,y);
ReleaseDC(Monitoring_App,hDC);
DeleteDC(hDC);
if(Color2Test == RGB(r,g,b))
{
Count++;
Test.Format("%d", Count);
m_CountText.SetWindowText(Test);
}
SetTimer(1,1,NULL);
Is there a better way to do this?
I could be wrong, will it be possible for me to capture the remainng 5 - 3 %, if I use a thread to monitor the change instead of the timer?
I have no clue about threads.
Once again any suggetions good or bad (there is never bad, we get to learn from them) will be greatly appreciated.