Consulting

Results 1 to 4 of 4

Thread: Can't find DLL entry point

  1. #1

    Can't find DLL entry point

    I have code to hide a userform title bar. Was working just fine for over a year and this week Office pushed an update and now I get the error message "Can't find DLL entry point FindWindowA in user 32". Here's my code...

    Option Explicit
    
    
    Public Const GWL_STYLE = -16
    Public Const WS_CAPTION = &HC00000
    #If VBA7 Then
        Public Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
        Public Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
        Public Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
        Public Declare PtrSafe Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    #Else
        Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
        Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
        Public Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
        Public Declare Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    #End If
    
    
    Sub HideTitleBar(frm As Object)
        Dim lngWindow As Long
        Dim lFrmHdl As Long
        lFrmHdl = FindWindowA(vbNullString, frm.Caption)
        lngWindow = GetWindowLong(lFrmHdl, GWL_STYLE)
        lngWindow = lngWindow And (Not WS_CAPTION)
        Call SetWindowLong(lFrmHdl, GWL_STYLE, lngWindow)
        Call DrawMenuBar(lFrmHdl)
    End Sub
    In the userform initialize i call HideTitleBar Me

    Any ideas on what broke and how to fix? thanks

  2. #2
    VBAX Expert
    Joined
    Aug 2004
    Posts
    810
    Location
    Shot in the dark, did you by chance got 64 bit version of Office? If so, you need to re-defined all your functions to 64 bit.

  3. #3
    Nope still the 32 bit version. From what I've read the behavior acts as if I'm using 64 bit. Still researching.

  4. #4
    I've determined this has to do with an update released on June 13 Version 1805 Build 9330.2124. From posts on other msg boards it appears to have affected VBA across the entire office suite. Hoping they catch this quick, it's been a big pain.

Posting Permissions

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