Is that WndProc() a class method? How do you declare it in the class to be called correctly? And how do you assign it to lpfnWndProc when creating the window class?

EDIT: Anyway, maybe it's a VCL event, so it doesn't apply to formless apps.