|
Public b As Boolean
#If Win64 Then
Private Declare PtrSafe Function ExtractIcon Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
Private Declare PtrSafe Function SendMessage Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As LongPtr
Private Declare PtrSafe Function FindWindow Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As LongPtr
Private Declare PtrSafe Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As LongPtr
Private Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As LongPtr
Private Declare PtrSafe Function SetFocus Lib "user32" (ByVal hWnd As Long) As LongPtr
#Else
Private Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
#End If
Private Const GWL_STYLE As Long = (-16)
Private Const GWL_EXSTYLE As Long = (-20)
Private Const WS_CAPTION As Long = &HC00000
Private Const WS_EX_DLGMODALFRAME As Long = &H1
Private Const SC_CLOSE As Long = &HF060
Private Const SW_SHOW As Long = 5
Private Sub Label1_Click()
End Sub
Private Sub UserForm_Activate()
Dim iStyle As Long
Dim hWndForm As Long
'hWndForm = FindWindow(vbNullString, Me.Caption)
'iStyle = GetWindowLong(hWndForm, GWL_STYLE)
iStyle = iStyle And Not WS_CAPTION
'SetWindowLong hWndForm, GWL_STYLE, iStyle
'iStyle = GetWindowLong(hWndForm, GWL_EXSTYLE)
iStyle = iStyle And Not WS_EX_DLGMODALFRAME
'SetWindowLong hWndForm, GWL_EXSTYLE, iStyle
'ShowWindow hWndForm, SW_SHOW
'DrawMenuBar hWndForm
'SetFocus hWndForm
End Sub
各位老师:想请教一下,分别在32位与64位系统运行,红色部分运行报错,子程序或函数未定义,要怎么弄?谢谢!
|
|