I am trying to use a simple C script to draw a icon on screen
But, Nothing appears.
How do i fix this?
I’ve tried setting hWnd
to 0, but didn’t work.
Anyways, heres my code:
#include <windows.h>
#include <stdio.h>
int main() {
HWND hWnd = GetDesktopWindow();
HDC hdc = GetDC(hWnd);
printf("%d",hWnd);
HICON hIcon = (HICON)LoadImage(NULL, L"Res/still.ico", IMAGE_ICON, 32, 32, LR_LOADFROMFILE);
DrawIcon(hdc, 15, 15, hIcon);
DestroyIcon(hIcon);
ReleaseDC(hWnd, hdc);
return 0;
}