Wednesday, 11 September 2013

Can I use single SetSubclassWindow procedure to subclass multiple edit controls, and if I can, how to do it?

Can I use single SetSubclassWindow procedure to subclass multiple edit
controls, and if I can, how to do it?

Can I use single SetSubclassWindow procedure to subclass multiple edit
controls, and if I can, how to do it?
I want to subclass multiple edit controls with the same subclass procedure.
So far, I did it like this:
SetWindowSubclass( GetDlgItem( hwnd, IDC_EDIT1 ), SomeSubclassProcedure,
0, 0);
SetWindowSubclass( GetDlgItem( hwnd, IDC_EDIT2 ), SomeSubclassProcedure,
0, 0);
Everything works, but I just want to check with more experienced
developers, so I can be sure, since I am a beginner.
Also, I would like to know if I should use RemoveWindowSubclass when I
destroy dialog box that contains edit controls.
I haven't used it in my code, since I pass no data as 4th parameter to the
SetWindowSubclass.

No comments:

Post a Comment