3 ms·
See also: http://thesiteformerlyknownas.zachtronicsindustries.com/notepad-weekend/ http://thesiteformerlyknownas.zachtronicsindustries.com/note... with http://t
by iamevn 4y ago
See also: http://thesiteformerlyknownas.zachtronicsindustries.com/notepad-weekend/ http://thesiteformerlyknownas.zachtronicsindustries.com/note... with http://thesiteformerlyknownas.zachtronicsindustries.com/images/notepad_hijack_framework.cpp http://thesiteformerlyknownas.zachtronicsindustries.com/imag... linked in the comments.
I had a lot of fun writing a few small games with this method, don't think I ever shared them anywhere though.
Here are the key bits:
char* c = "Hello World!";
HWND hwnd = FindWindow("Notepad", NULL);
HWND edit = FindWindowEx(hwnd, NULL, "Edit", NULL);
SendMessage(edit, WM_SETTEXT, NULL, (LPARAM)c);
- huhtenberg 4y agoIt's rather unlikely to get you anywhere close to 60 fps. I'd guess that they do wm_settext once and then update notepad's copy of the text directly, triggering a repaint after each update.
- justsomehnguy 4y agoBanding suggests this.