ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

EH搜索     
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 Excel Home精品图文教程库
Excel不给力? 何不试试FoxTable! Excel 2016函数公式学习大典 Office知识技巧免费学 打造核心竞争力的职场宝典
300集Office 2010微视频教程 Tableau-数据可视化工具 精品推荐-800套精选PPT模板,点击获取 ExcelHome出品 - VBA代码宝免费下载
你的Excel 2010实战技巧学习锦囊 欲罢不能, 过目难忘的 Office 新界面 Excel VBA经典代码实践指南
查看: 165|回复: 0

[求助] 32位与64位兼容的问题

[复制链接]

TA的精华主题

TA的得分主题

发表于 2020-1-11 14:50 | 显示全部楼层 |阅读模式
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位系统运行,红色部分运行报错,子程序或函数未定义,要怎么弄?谢谢!

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

关注官方微信,每天学会一个新技能

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2020-5-27 17:25 , Processed in 0.058438 second(s), 13 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2020 Wooffice Inc.

   

沪公网安备 31011702000001号 沪ICP备11019229号

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:徐怀玉律师 李志群律师

快速回复 返回顶部 返回列表