我只发现了这个问题,还没有回答。
是否有可能获得所有信息?
到目前为止,我已经能够获得功能区本身的屏幕坐标,但我无法获得功能区按钮的位置。
这是我用于获取功能区位置和大小的片段:
RECT rect = new RECT();
GetWindowRect(Process.GetCurrentProcess().MainWindowHandle, ref rect);
this.ribbonRect.X = rect.Left;
this.ribbonRect.Y = rect.Top;
this.ribbonRect.Width = rect.Right - rect.Left;
this.ribbonRect.Height = Globals.ThisAddIn.Application.CommandBars["Ribbon"].Height;