Refresh the Office Ribbon UI while the window is inactive

倖福魔咒の 提交于 2019-12-11 12:02:28

问题


I am working on a Office Ribbon project. (PowerPoint)

A label on it is being periodically updated from a timer. (It is displaying the current number of connections to our server)

When the PowerPoint window is in focus, the label is updated correctly. However, when the window is inactive, the updates are suspended. (they appear only after the PowerPoint window receives focus)

This is an issue for multi-monitor setups, or when snapping PowerPoint to a half of the screen - we need correct data to be displayed.

I understand that the idea behind this is to lower the CPU load, but I would like to override the behavior.

I tried the Invalidate, PerformLayout and similar methods, but can't get the ribbon to refresh. Is there any way to do this?


回答1:


Nope. There is no way to update the Fluent UI in all windows. The callbacks are invoked when the window becomes active.

You may consider creating Custom Task Panes for such needs. In that case you will be able to control each instance separately and update the UI at runtime. You may find the following articles helpful:

  • Walkthrough: Automating an Application from a Custom Task Pane
  • Managing Custom Task Panes in Multiple Application Windows


来源:https://stackoverflow.com/questions/29351196/refresh-the-office-ribbon-ui-while-the-window-is-inactive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!