Phil
11-02-2000, 10:45 AM
Hi All,
I've subclassed the MDI form of my app. in order to control its resizing and it works well thanks to the help of Jared (my previous post - WM_SIZING).
The problem I have is that when running my code from the IDE, when I exit the program the project IDE exits as well. I can comment-out the calls to the hook and unhook proceedures when developing and it works fine when compiled so its not a tremendous worry but if anyone could suggest why this is happening it'd be greatly appreciated. The code is as follows:
Public Sub apMapperHook()
lpPrevMapperWndProc = SetWindowLong(gMapperHW, GWL_WNDPROC, AddressOf MapperWindowProc)
End Sub
Public Sub apMapperUnhook()
Dim temp As Long
temp = SetWindowLong(gMapperHW, GWL_WNDPROC, lpPrevMapperWndProc)
End Sub
Private Function MapperWindowProc(ByVal hw As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If uMsg = WM_GETMINMAXINFO Then
'Call proceedure that fills MINMAXINFO structure with my
'settings then redirect to default window proceedure
Call MsgReceived(lParam)
MapperWindowProc = DefWindowProc(hw, uMsg, wParam, lParam)
Else
MapperWindowProc = CallWindowProc(lpPrevMapperWndProc, hw, uMsg, wParam, lParam)
End If
End Function
apMapperHook is called from the MDI form load event and apMapperUnHook is called from the MDI form queryUnload event.
I've subclassed the MDI form of my app. in order to control its resizing and it works well thanks to the help of Jared (my previous post - WM_SIZING).
The problem I have is that when running my code from the IDE, when I exit the program the project IDE exits as well. I can comment-out the calls to the hook and unhook proceedures when developing and it works fine when compiled so its not a tremendous worry but if anyone could suggest why this is happening it'd be greatly appreciated. The code is as follows:
Public Sub apMapperHook()
lpPrevMapperWndProc = SetWindowLong(gMapperHW, GWL_WNDPROC, AddressOf MapperWindowProc)
End Sub
Public Sub apMapperUnhook()
Dim temp As Long
temp = SetWindowLong(gMapperHW, GWL_WNDPROC, lpPrevMapperWndProc)
End Sub
Private Function MapperWindowProc(ByVal hw As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If uMsg = WM_GETMINMAXINFO Then
'Call proceedure that fills MINMAXINFO structure with my
'settings then redirect to default window proceedure
Call MsgReceived(lParam)
MapperWindowProc = DefWindowProc(hw, uMsg, wParam, lParam)
Else
MapperWindowProc = CallWindowProc(lpPrevMapperWndProc, hw, uMsg, wParam, lParam)
End If
End Function
apMapperHook is called from the MDI form load event and apMapperUnHook is called from the MDI form queryUnload event.