GetDesktopRect – Get size and position of available desktop area

GetDesktopRect – Get size and position of available desktop area

Private Type RECT    Left As Long    Top As Long    Right As Long    Bottom As LongEnd TypePrivate Const SPI_GETWORKAREA = 48Private Declare Function SystemParametersInfo Lib "user32" Alias _    "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, _    ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long' Return information on screen's available area' that is, the rectangle that isn't taken by any' taskbar that is always visible'' the area size and posizion are returned in the first 4 arguments' all values are in pixels, or in twips' if the last argument is set to True'' Usage:'   Dim le As Long, tp As Long, wi As Long, he As Long'   GetDesktopRect le, tp, wi, he, True'   MsgBox "Left=" & le & vbCr & "Top=" & tp & vbCr '      & "Width=" & wi & ' vbCr & "Height=" & heSub GetDesktopRectt(Left As Long, Top As Long, Width As Long, Height As Long, _    Optional ReturnAsTwips As Boolean)    Dim lpRect As RECT    SystemParametersInfo SPI_GETWORKAREA, 0, lpRect, 0    ' extract values    Left = lpRect.Left    Top = lpRect.Top    Width = lpRect.Right - lpRect.Left    Height = lpRect.Bottom - lpRect.Top    ' convert to twips if requested    If ReturnAsTwips Then        Left = Left * Screen.TwipsPerPixelX        Top = Top * Screen.TwipsPerPixelY        Width = Width * Screen.TwipsPerPixelX        Height = Height * Screen.TwipsPerPixelY    End IfEnd Sub

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several