Might only need the GetForegroundWindow API.

API:
Declare Function GetForegroundWindow Lib "user32" Alias "GetForegroundWindow" () As Long

Code:
If GetForegroundWindow = Me.hWnd Then
'Your form has the focus
Else
'Your form doesn't have the focus
End If

Might be what you want, might not...