win32_utf8 icon indicating copy to clipboard operation
win32_utf8 copied to clipboard

Strange thing about RegisterClass: the lpfnWndProc property of WNDCLASS struct

Open Meigyoku-Thmn opened this issue 7 years ago • 2 comments

At here https://github.com/thpatch/win32_utf8/blob/master/src/user32_dll.c#L45 I find it's very strange that you just copy the lpfnWndProc without doing anything more. A WindowProc callback can receive certain messages (such as WM_CREATE) which have string in lParam or wParam. So if we pass a WindowProc to RegisterClassW, then it can receive wide character string. But the WindowProc itself is programmed to handle only ANSI string (or Multibyte string). So how can it work properly?

Meigyoku-Thmn avatar Jan 10 '17 16:01 Meigyoku-Thmn

That's a good question. The repository was last updated in 2019 though, so this might have already been addressed.

Amaroq-Clearwater avatar Apr 24 '20 17:04 Amaroq-Clearwater

Nope, I think that's still the case. The only thing we do is replacing DefWindowProcA with DefWindowProcW. This project is pushed by the needs of thcrap, which itself is pushed by the Touhou Project games, so I guess these games just don't do that.

brliron avatar Apr 26 '20 16:04 brliron