windowp.bas

来自「常用基本函数库,也许你需要的正在其中!如果不做程序」· BAS 代码 · 共 30 行

BAS
30
字号
Option Explicit

Declare Sub SetWindowPos Lib "User" (ByVal hWnd As Integer, ByVal hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer)
   Global Const SWP_NOACTIVATE = &H10
   Global Const SWP_SHOWWINDOW = &H40
   Global Const HWND_TOPMOST = -1
   Global Const HWND_NOTOPMOST = -2

Sub SetOnTop (Pos%, aForm As Form)

' Description
'     Makes aForm the top-most window
'
' Parameters
'     Name                    Type     Value
'     -------------------------------------------------------------------------
'     Pos                     Integer  HWND_TOPMOST   if form is to be on top
'                                      HWND_NOTOPMOST if form is be not on top
'     aForm                   Form     The form to set (not) on top
'
' Returns
'     Nothing
'
' Last modified by Jens Balchen 10.03.1996

   SetWindowPos aForm.hWnd, Pos%, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW

End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?