Results 1 to 12 of 12

Thread: Can't find DLL entry point.....user32

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    9

    Can't find DLL entry point.....user32

    I am using Vb6 and trying to hide or disable the form close button.
    The code I am using is below.
    On my development machine (WinXP sp2.0) this works but on the target machine (WinXP sp2.0) I get the following error
    Can't find DLL entrypoint GetSystemMenu in user32.

    Can any body help!!
    vb Code:
    1. Private Const MF_BYPOSITION = &H400
    2. Private Const MF_REMOVE = &H1000
    3.  
    4. Private Declare Function DrawMenuBar Lib "user32" _
    5.       (ByVal hwnd As Long) As Long
    6.      
    7. Private Declare Function GetMenuItemCount Lib "user32" _
    8.       (ByVal hMenu As Long) As Long
    9.      
    10. Private Declare Function GetSystemMenu Lib "user32" _
    11.       (ByVal hwnd As Long, _
    12.        ByVal bRevert As Long) As Long
    13.        
    14. Private Declare Function RemoveMenu Lib "user32" _
    15.       (ByVal hMenu As Long, _
    16.        ByVal nPosition As Long, _
    17.        ByVal wFlags As Long) As Long
    18.  
    19.  
    20.  
    21. Private Sub Form_Load()
    22.  
    23.    Dim hMenu As Long
    24.    Dim menuItemCount As Long
    25.  
    26.   'Obtain the handle to the form's system menu
    27.    hMenu = GetSystemMenu(Me.hwnd, 0)
    28.  
    29.    If hMenu Then
    30.      
    31.      'Obtain the number of items in the menu
    32.       menuItemCount = GetMenuItemCount(hMenu)
    33.    
    34.      'Remove the system menu Close menu item.
    35.      'The menu item is 0-based, so the last
    36.      'item on the menu is menuItemCount - 1
    37.       Call RemoveMenu(hMenu, menuItemCount - 1, _
    38.                       MF_REMOVE Or MF_BYPOSITION)
    39.    
    40.      'Remove the system menu separator line
    41.       Call RemoveMenu(hMenu, menuItemCount - 2, _
    42.                       MF_REMOVE Or MF_BYPOSITION)
    43.    
    44.      'Force a redraw of the menu. This
    45.      'refreshes the titlebar, dimming the X
    46.       Call DrawMenuBar(Me.hwnd)
    47.  
    48.    End If
    49.    
    50. End Sub
    Last edited by Hack; Apr 19th, 2007 at 07:29 AM. Reason: Added VB Highlight Tags

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