I have written a little pgm in VB6, which works as follows. When I click on the command button, my pgm uses API's to get the current 'in focus' windows handle (Hwnd) and displays it in a mesage box. Its just a few lines of code in the command1 click event. I want to run this pgm as a background application so that it doesn't rely on me clicking any button to get it to work and every 30 secs gets the current 'in focus' window handle and displays it in a msgbox. Perhaps VB6 is not the best langage to use and I should use java for this type of code ?