How to avoid detection of a program as a Trojan?

I made a small program to detect mouse movement from screen to another in multi-screen configuration and it is detected as a Trojan in windows 10 by Windows Defender. On my computer, it is not detected (windows 7 pro 64) by Windows defender and my antivirus. I only use a few functions:

GetCursorPos(&P);

...

HWND hwnd = WindowFromPoint(P);
            HWND hparent = GetParent(hwnd);
            while (hparent)
            {
                hwnd = hparent;
                hparent = GetParent(hwnd);
            }
SetForegroundWindow(hwnd);

      

Is there something in this code that might be suspicious?

thank

+3


source to share





All Articles