Private Sub Timer1_Timer()
Dim x As Long
Dim y As Long
Dim W As Long
Dim H As Long
W = Me.Width / Screen.TwipsPerPixelX
H = Me.Height / Screen.TwipsPerPixelY
x = (Screen.Width / Screen.TwipsPerPixelX - W) / 2
y = (Screen.Height / Screen.TwipsPerPixelY - H) / 2
SetWindowPos Me.hwnd, HWND_TOP, x, y, W, H, SWP_NOMOVE And SWP_NOSIZE