thanx guys. that worked perfectly. i ended up just adding a hWnd parameter and it worked fine.