
Originally Posted by
Karl77
SUBCLASSING ADVICE
Up to now I use SSUBTMR6.DLL for subclassing.
From now on, I want to use the same technique that Krool uses in his controls.
I'm stuck.
Implements ISubclass creates the ISubclass_Message function, and I could do what I want from there.
But I don't know how to bring messages into the game.
In SSUBTMR6.DLL I simply had to attach/detach messages, which I could process in ISubclass_WindowProc.
How does it work with Krool's subclassing?
A very basic example would help me out.
Thank you.
Edit:
I try this in the main form of the example (post #1).
Krool's method (common controls subclassing) does not filter messages. unless intercepted, you get them all.
also you gotta make sure you forward to ComCtlsDefaultProc (DefSubclassProc) in your ISubclass_Message
Code:
Option Explicit
Implements ISubclass
Private Sub Form_Load()
ComCtlsSetSubclass hWnd, Me, 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
ComCtlsRemoveSubclass hWnd
End Sub
Private Function ISubclass_Message(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long, ByVal dwRefData As Long) As Long
Select Case wMsg
Case WM_DESTROY
End Select
ISubclass_Message = ComCtlsDefaultProc(hWnd, wMsg, wParam, lParam)
End Function