Found this code off a google search to remove the close "X" from the title bar. But when I go to compile it throws an error.
Compile error: The code in this project must be updated for use on 64-bit systems. Please review and update Declare statements and then mark them PtrSafe attribute.
What do I need to do to fix this? I get it on all 3 Private Declare Functions.
Compile error: The code in this project must be updated for use on 64-bit systems. Please review and update Declare statements and then mark them PtrSafe attribute.
Code:
Private Const GWL_EXSTYLE = (-20) Private Const GWL_STYLE = (-16) Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_SYSMENU = &H80000 Private Const HWND_TOP = 0 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_DRAWFRAME = SWP_FRAMECHANGED Private Declare Function SetWindowLong Lib "user32" _ Alias "SetWindowLongA" (ByVal hwnd As Long, _ ByVal nIndex As Long, ByVal dwNewLong As Long) _ As Long Private Declare Function GetWindowLong Lib "user32" _ Alias "GetWindowLongA" (ByVal hwnd As Long, _ ByVal nIndex As Long) As Long Private Declare Function SetWindowPos Lib "user32" _ (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _ ByVal x As Long, ByVal y As Long, ByVal cx As Long, _ ByVal cy As Long, ByVal wFlags As Long) As Long Sub HideAccessCloseButton() Dim lngStyle As Long lngStyle = GetWindowLong(hWndAccessApp, GWL_STYLE) lngStyle = lngStyle And Not WS_SYSMENU Call SetWindowLong(hWndAccessApp, GWL_STYLE, lngStyle) Call SetWindowPos(hWndAccessApp, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_DRAWFRAME) End Sub
Comment