Download and reference EventVB.dll to utilize the code in red, which stops the user from resizing by doubleclicking the caption (title) bar...

VB Code:
  1. ' In Declarations Area
  2.  
  3. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
  4. Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
  5. Private Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
  6. Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
  7. Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
  8. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  9. Const MF_BYPOSITION = &H400&
  10. Const MF_REMOVE = &H1000&
  11.  
  12. [color=red]
  13.  
  14. Dim WithEvents vbLink As EventVB.APIFunctions
  15.  
  16. Dim WithEvents vbWnd As EventVB.ApiWindow
  17.  
  18. [/color]
  19.  
  20. ' Setting the MDI buttons
  21.  
  22.         Dim hSysMenu As Long, nCnt As Long
  23.        
  24.         ' GET HANDLE TO OUR FORM'S SYSTEM MENU
  25.        
  26.         ' (RESTORE, MAXIMIZE, MOVE, CLOSE ETC.)
  27.        
  28.         hSysMenu = GetSystemMenu(Me.hwnd, False)
  29.        
  30.         If hSysMenu Then
  31.            
  32.             ' GET SYSTEM MENU'S MENU COUNT
  33.            
  34.             nCnt = GetMenuItemCount(hSysMenu)
  35.            
  36.             If nCnt Then
  37.                
  38.                 Dim x As Byte
  39.                
  40.                 For x = 1 To 100
  41.                    
  42.                     ' MENU COUNT IS BASED ON 0 (0, 1, 2, 3...)
  43.                    
  44.                     RemoveMenu hSysMenu, nCnt - x, MF_BYPOSITION Or MF_REMOVE
  45.                    
  46.                 Next
  47.                
  48.                 DrawMenuBar Me.hwnd
  49.                
  50.             End If
  51.            
  52.         End If
  53.  
  54. [color=red]
  55.  
  56.         ' To Disable the doubleclick
  57.  
  58.         Set vbLink = New EventVB.APIFunctions
  59.        
  60.         Set vbWnd = New EventVB.ApiWindow
  61.        
  62.         vbWnd.hwnd = Me.hwnd
  63.        
  64.         ' SUBCLASS THIS FORM....
  65.        
  66.         vbLink.SubclassedWindows.Add vbWnd
  67.        
  68.         ' TO DISABLE DOUBLECLICK SIZING ON MDIFORM
  69.        
  70.         Dim lngStyle As Long
  71.        
  72.         Me.WindowState = vbMaximized
  73.        
  74.         Me.Show
  75.        
  76.         lngStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
  77.        
  78.         lngStyle = lngStyle And Not (WS_MAXIMIZEBOX) Xor WS_MAXIMIZE
  79.        
  80.         lngStyle = SetWindowLong(Me.hwnd, GWL_STYLE, lngStyle)
  81.  
  82. [/color]