Last active
May 29, 2020 18:07
-
-
Save stevemk14ebr/e7d5aecb871946a7e3bf9a25c2cc8077 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.reddit.com/r/programming/comments/gnazif/ray_tracing_in_notepadexe_at_30_fps/ | |
static void nlog(char *str, ...) | |
{ | |
HWND notepad, edit; | |
va_list ap; | |
char buf[256]; | |
va_start(ap, str); | |
vsprintf(buf, str, ap); | |
va_end(ap); | |
strcat(buf, "\r\n"); | |
notepad = FindWindow(NULL, "Untitled - Notepad"); | |
edit = FindWindowEx(notepad, NULL, "EDIT", NULL); | |
SendMessage(edit, EM_REPLACESEL, TRUE, (LPARAM)buf); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment