In a window, i try to set the focus on another window here's my code :

VB Code:
  1. Private Declare Function SetActiveWindow Lib "user32.dll" (ByVal hWnd As Long) As Long
  2.  
  3. '...
  4. SetActiveWindow lhWnd  
  5. 'lhWnd is a  variable containing the hwnd of the form i want to set focus on

But for a reason or another the focus stays on the window in wich i called this function. is there something wrong here? thanks