如何防止PowerPoint(Office 365 64位)窗口重新绘制?

发布于 2025-01-21 20:31:32 字数 1024 浏览 2 评论 0 原文

我有一个图形激烈的PowerPoint加载项,该加载项正在重新绘制屏幕。 I'm trying to lock the PowerPoint window from VBA while the changes are being made with the following code (64-bit Office):

Private Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" _
    (ByVal hWnd As LongPtr, ByVal wMsg As Long, _
     ByVal wParam As LongPtr, Optional lParam As Any) As LongPtr
Public Const WM_SETREDRAW = &HB

Sub testLock()
    Static hWnd As LongPtr
    hWnd = FindWindow("PPTFrameClass")
    SendMessage hWnd, WM_SETREDRAW, False, 0&
End Sub

Sub testUnlock()
    Static hWnd As LongPtr
    hWnd = FindWindow("PPTFrameClass")
    SendMessage hWnd, WM_SETREDRAW, True, 0&
End Sub

When I do, this is the result (a mostly white window, with some stray lines):

What am I doing wrong?我也尝试了lockwindowupdate,但不能阻止更新。

I have a graphics intense PowerPoint Add-in that is redrawing the screen. I'm trying to lock the PowerPoint window from VBA while the changes are being made with the following code (64-bit Office):

Private Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" _
    (ByVal hWnd As LongPtr, ByVal wMsg As Long, _
     ByVal wParam As LongPtr, Optional lParam As Any) As LongPtr
Public Const WM_SETREDRAW = &HB

Sub testLock()
    Static hWnd As LongPtr
    hWnd = FindWindow("PPTFrameClass")
    SendMessage hWnd, WM_SETREDRAW, False, 0&
End Sub

Sub testUnlock()
    Static hWnd As LongPtr
    hWnd = FindWindow("PPTFrameClass")
    SendMessage hWnd, WM_SETREDRAW, True, 0&
End Sub

When I do, this is the result (a mostly white window, with some stray lines):
enter image description here

What am I doing wrong? I tried LockWindowUpdate too and it does not prevent updates.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文