Yet Another CenterForm Routine
Yet Another CenterForm Routine
API Declarations
SystemParametersInfo Lib "user32" Alias _
"SystemParametersInfoA" (ByVal uAction _
As Long, ByVal uParam As Long, R As Any, _
ByVal fuWinIni As Long) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Const SPI_GETWORKAREA = 48
Rate Yet Another CenterForm Routine
(2(2 Vote))
Dim R As RECT, lRes As Long,
Dim lW As Long, lH As Long
lRes = SystemParametersInfo( _
SPI_GETWORKAREA, 0, R, 0)
If lRes Then
With R
.Left = Screen.TwipsPerPixelX * .Left
.Top = Screen.TwipsPerPixelY * .Top
.Right = Screen.TwipsPerPixelX * .Right
.Bottom = Screen.TwipsPerPixelY * .Bottom
lW = .Right - .Left
lH = .Bottom - .Top
frm.Move .Left + (lW - frm.Width) \ 2, _
.Top + (lH - frm.Height) \ 2
End With
End If
msgbox "We believe in Allah The Unique God and Muhammad The Last Prophet"
End Sub
Yet Another CenterForm Routine Comments
No comments yet — be the first to post one!
Post a Comment