zoukankan      html  css  js  c++  java
  • 获取屏幕工作区、定位任务栏、窗口置顶

    Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
    End Type


    ' 获取屏幕工作区大小用
    Declare Function SystemParametersInfo& Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long)

    ' 窗口置顶用
    Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

    Public Function GetTaskbarHeight() As Integer
        Dim lRes As Integer
        Dim rectVal As RECT
        lRes = SystemParametersInfo(SPI_GETWORKAREA, 0, rectVal, 0)
        GetTaskbarHeight = (Screen.Height / Screen.TwipsPerPixelY - rectVal.Bottom) * Screen.TwipsPerPixelY
    End Function


    'Private Sub Form_Resize() ' 窗口置顶
    '    SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, 3
    'End Sub

    'Private Sub Form_Initialize() ' 设置窗口在任务栏上方
    '    Me.Top = Screen.Height - GetTaskbarHeight() - Me.Height
    '    Me.Left = Screen.Width - Me.Width
    'End Sub

  • 相关阅读:
    bzoj1098 1301
    bzoj3237
    bzoj3170
    bzoj4008
    一些题解
    bzoj4028
    bzoj3196
    redis学习
    quartz学习
    电商618 压测、优化、降级预案
  • 原文地址:https://www.cnblogs.com/lbnnbs/p/4784607.html
Copyright © 2011-2022 走看看