none
gdi draw problem RRS feed

  • Question

  • this code is working fine for normal .exe files and it draw a rec on the target app, but it don't work on uwp apps like calculator, microsoft store..etc , is there a way to fix that ?

    #include <stdio.h>
    #include <Windows.h>

    int main() {

    HWND hwnd = FindWindow(NULL,"Hex Workshop");
    HBRUSH hbrush = CreateSolidBrush(RGB(10,4,106));
    HDC hdc = GetDC(hwnd);
    RECT rec = {10,10,70,70};

    FillRect(hdc,&rec,hbrush);

    getchar();
    return 0;
    }

    Monday, November 2, 2020 2:51 PM