can someone give me functions or subs on finding the window handle of the active window and how to close it pls.

pls help me fellow programmers!!

thanx!!!