Professional Documents
Culture Documents
If RC.Left < 0 Or RC.Right > Scr.Right Or RC.Bottom > Scr.Bottom Or RC.Top <
0 Then
'Lift-up the left mouse button
mouse_event MOUSEEVENTF_LEFTUP, 0&, 0&, 0&, 0&
'Set new Window position
FrmL = RC.Left
FrmT = RC.Top
If RC.Left < 0 Then FrmL = 0
If RC.Right > Scr.Right Then FrmL = Scr.Right - FrmW
If RC.Top < 0 Then FrmT = 0
If RC.Bottom > Scr.Bottom Then FrmT = Scr.Bottom - FrmH
'Move the window
MoveWindow ThisWindow, FrmL, FrmT, FrmW, FrmH, 1&
End If
End Sub