当前位置:首页教育技巧word技巧word基础知识

如何让word窗口置顶

减小字体 增大字体 2025-12-21 10:02:23


1.如何让word永远在显示器最上面一层

word本身不支持该功能

设置窗口为顶层表单需要使用API,但是在模块里试了半天也无法实现,可能不支持了。测试代码如下:

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Declare Function SetWindowPos Lib "user32" (HWND&, ord&, x&, y&, dx&, dy&, uflag&) As Long

Public Sub TopWindow()

Dim myHwnd As Long

myHwnd = FindWindow(vbNullString, ActiveDocument.ActiveWindow.Caption & " - Microsoft Word")

Const HWND_TOP = -1

Const SWP_NOMOVE = 3

SetWindowPos myHwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE

End Sub

评论评论内容只代表网友观点,与本站立场无关!

   评论摘要(共 0 条,得分 0 分,平均 0 分)

【免责声明】本站信息来自网友投稿及网络整理,内容仅供参考,如果有错误请反馈给我们及时更正,对文中内容的真实性和完整性本站不提供任何保证,不承但任何责任。
版权所有:学窍知识网 Copyright © 2011-2026 www.at317.com All Rights Reserved .