You can use the SystemParametersInfo with SPI_GETWORKAREA action to get the size and location of the work area not obscured by taskbar and other toolbars.
The following vb code positions the form at the bottom right corner of the screen (near the clock) before showing it.
___
[tt]
Option Explicit
Private 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
Private Const SPI_GETWORKAREA = 48
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Form_Load()
Dim r As RECT
SystemParametersInfo SPI_GETWORKAREA, 0, r, 0
Left = r.Right * Screen.TwipsPerPixelX - Width
Top = r.Bottom * Screen.TwipsPerPixelX - Height
End Sub
[/tt]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.