I'm new to subclassing and I'm having a problem applying it to an MDI parent form. It works perfectly for MDI children and modal forms, but it always causes VB to close when the program ends and the MDI parent unloads.
In the MDI Form Load event I've got:
PrevWndProc = SetWindowLong(hwnd, -4, AddressOf FormResizeWndProc)
In the MDI Form Unload event I've got:
A& = SetWindowLong(hwnd, -4, PrevWndProc)
(where PrevWndProc is a form-defined variable)
While the program is running it correctly intercepts the events I'm interested in (wm_size for example) - in fact it all works fine until it tries to unhook from the subclass handler, at which point the program closes and VB closes too.
Is an MDI Parent a special case? Am I doing something obviously wrong?
- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
In the MDI Form Load event I've got:
PrevWndProc = SetWindowLong(hwnd, -4, AddressOf FormResizeWndProc)
In the MDI Form Unload event I've got:
A& = SetWindowLong(hwnd, -4, PrevWndProc)
(where PrevWndProc is a form-defined variable)
While the program is running it correctly intercepts the events I'm interested in (wm_size for example) - in fact it all works fine until it tries to unhook from the subclass handler, at which point the program closes and VB closes too.
Is an MDI Parent a special case? Am I doing something obviously wrong?
- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments