Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange thing about RegisterClass: the lpfnWndProc property of WNDCLASS struct #1

Open
Meigyoku-Thmn opened this issue Jan 10, 2017 · 5 comments

Comments

@Meigyoku-Thmn
Copy link

Meigyoku-Thmn commented Jan 10, 2017

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 Meigyoku-Thmn changed the title Strange thing about RegisterClass hook: the lpfnWndProc property of WNDCLASS struct Strange thing about RegisterClass: the lpfnWndProc property of WNDCLASS struct Jan 10, 2017
@Amaroq-Clearwater
Copy link

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

@brliron
Copy link
Member

brliron commented Apr 26, 2020

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.

@Amaroq-Clearwater
Copy link

Amaroq-Clearwater commented May 18, 2024

This project should probably be forked then, that way it can be updated more frequently for a more general use case.

@brliron
Copy link
Member

brliron commented May 19, 2024

I don't think a fork would fix this issue. What this project would need, in order to have greater compatibility than whatever the Touhou Project games need, is more contributors.

@Amaroq-Clearwater
Copy link

Might wanna advertise it then.
And win32_smartdlg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants