MS Word VBA x32 ->x64 转换,替代 SetParent?

发布于 2025-01-10 23:09:38 字数 236 浏览 0 评论 0原文

我有一个旧的 Word 文档,其中包含 x32 内置的 VBA,我需要更新它才能在 x64 中工作。我一直在寻找损坏的 x32 声明并替换它们,但我很难找到以下内容的替代品。

Private Declare Function SetParent Lib "user32.dll" _
(ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

I have an old Word document with VBA built in x32 and I need to updated it to work in x64. I've been going through finding the broken x32 declarations and replacing them, but I've having trouble finding a replacement for the following.

Private Declare Function SetParent Lib "user32.dll" _
(ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烛影斜 2025-01-17 23:09:38

Ron de Bruin:Excel 自动化是转换 API 调用时的救星。

#If VBA7 Then
    Public Declare PtrSafe Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As LongPtr, ByVal hWndNewParent As LongPtr) As LongPtr
#Else
    Private Declare Function SetParent Lib "user32.dll" ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
#End If

Ron de Bruin: Excel Automation is a lifesaver when it comes to converting API calls.

#If VBA7 Then
    Public Declare PtrSafe Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As LongPtr, ByVal hWndNewParent As LongPtr) As LongPtr
#Else
    Private Declare Function SetParent Lib "user32.dll" ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
#End If
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文