POINT Pts; RECT WndPos; HWND hWnd = FindWindow("Shell_TrayWnd", NULL); while(TRUE){ Sleep(1); GetCursorPos(&Pts); GetWindowRect(hWnd, &WndPos); if(Pts.x >= WndPos.left && Pts.x <= WndPos.right && Pts.y >= WndPos.top && Pts.y <= WndPos.bottom){ //Send hover message }else{ //Send non hover message } }