When you call the SetParent function to allow a standard form to become a child form of a multiple-document interface (MDI) application, many child windowing features do not work.
http://support.microsoft.com/support/kb/articles/Q253/8/14.asp
PRB: SetParent Does Not Change Standard Forms into Child Wind
to glassnake:
就是容纳MDI子窗体的那个窗口啊,可用FindwindowEx或GetWindow函数获得其HWND
【VB声明】
Private Declare Function GetWindow Lib "user32" Alias "GetWindow" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
【VB声明】
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Sub Form_Load()
OldWindowStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
OldParent = SetParent(Me.hwnd, MainForm.picPageBox.hwnd)
Call SetWindowLong(Me.hwnd, GWL_STYLE, OldWindowStyle Or WS_CHILD)
End Sub