Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subclassing lightweight controls

Status
Not open for further replies.

paulbent

Programmer
Mar 4, 2002
1,071
GB
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top