Results 1 to 6 of 6

Thread: API function to remove min button in MDIform

  1. #1
    Megatron
    Guest
    Try this:
    VB Code:
    1. Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
    2. Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
    3. Private Const MF_BYPOSITION = &H400&
    4.  
    5. Private Sub Form_Load()
    6.     'Remove sizing
    7.     Call RemoveMenu(GetSystemMenu(hwnd, 0), 2, MF_BYPOSITION)
    8.     'Remove minimizing
    9.     Call RemoveMenu(GetSystemMenu(hwnd, 0), 2, MF_BYPOSITION)
    10. End Sub

  2. #2
    Matthew Gates
    Guest
    Originally posted by Megatron
    Try this:
    VB Code:
    1. Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
    2. Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
    3. Private Const MF_BYPOSITION = &H400&
    4.  
    5. Private Sub Form_Load()
    6.     'Remove sizing
    7.     Call RemoveMenu(GetSystemMenu(hwnd, 0), 2, MF_BYPOSITION)
    8.     'Remove minimizing
    9.     Call RemoveMenu(GetSystemMenu(hwnd, 0), 2, MF_BYPOSITION)
    10. End Sub


    Minimizing should be changed to 3.
    2 = Resizing
    3 = Minimizing


    VB Code:
    1. Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu _
    2. As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
    3.  
    4. Private Declare Function GetSystemMenu Lib "user32" (ByVal _
    5. hwnd As Long, ByVal bRevert As Long) As Long
    6.  
    7. Private Const MF_BYPOSITION = &H400&
    8.  
    9. Private Sub Form_Load()
    10.     'Remove sizing
    11.     Call RemoveMenu(GetSystemMenu(hwnd, 0), [b]2[/b], MF_BYPOSITION)
    12.     'Remove minimizing
    13.     Call RemoveMenu(GetSystemMenu(hwnd, 0), [b]3[/b], MF_BYPOSITION)
    14. End Sub

  3. #3
    Megatron
    Guest
    No it shouldn't.

    Removing the size causes each menu to move down one level, then Minimize goes from 3 to 2.

  4. #4
    Junior Member
    Join Date
    Jun 2001
    Location
    Hong Kong
    Posts
    31

    Talking



    Thank you Megatron and Matthew.

  5. #5
    Matthew Gates
    Guest
    Ah, I see Megatron. Wow, I didn't know that worked like that, very neat.

  6. #6
    Megatron
    Guest
    If you removed the higher indexed menu first, then it'll work fine without the "push" effect.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width