It shouldn't be possible to subclass a lightweight control because it doesn't have a window handle.
I do a lot of client work with Lotus Approach, a desktop database that uses lightweight controls on its forms, much the same as MS Office. It has a scripting language very similar to VBA. It supports ActiveX components and forward declarations of C functions but doesn't have AddressOf or anything that exposes a pointer to a callback function.
I've noticed that while a lightweight control has focus, it temporarilly acquires a hwnd. I'm planning to write an OCX to subclass the Approach Document Window and am wondering if it's possible to extend this to lightweight controls when they have focus.
The main problem I see is that the LostFocus event of the control fires after the hwnd has been destroyed so there's no way to turn off subclassing and avoid a GPF.
Perhaps it could be done with a message hook if I can work out which message destroys the hwnd.
I was wondering if anyone has any experiences to share re subclassing lightweight controls or links to examples etc.
Paul Bent
Northwind IT Systems
I do a lot of client work with Lotus Approach, a desktop database that uses lightweight controls on its forms, much the same as MS Office. It has a scripting language very similar to VBA. It supports ActiveX components and forward declarations of C functions but doesn't have AddressOf or anything that exposes a pointer to a callback function.
I've noticed that while a lightweight control has focus, it temporarilly acquires a hwnd. I'm planning to write an OCX to subclass the Approach Document Window and am wondering if it's possible to extend this to lightweight controls when they have focus.
The main problem I see is that the LostFocus event of the control fires after the hwnd has been destroyed so there's no way to turn off subclassing and avoid a GPF.
Perhaps it could be done with a message hook if I can work out which message destroys the hwnd.
I was wondering if anyone has any experiences to share re subclassing lightweight controls or links to examples etc.
Paul Bent
Northwind IT Systems