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

  • 相关阅读:
    JavaScript与C# Windows应用程序交互方法
    CREATE TABLE 表名 AS SELECT 语句
    从新开始
    window下安装redis
    最终,我们都变成了机器
    这个网址很学习
    改变你一生命运的话语 不得不信
    看《超级演说家》有感
    网页布局的一点感触
    最近状态不好
  • 原文地址:https://www.cnblogs.com/lbnnbs/p/4784607.html
Copyright © 2011-2022 走看看