Is it possible to disable Screen timeout only when a particular program is running?

If so, how do I do that?

My Nexus One has a "Screen timeout" in "Display settings" that lets me choose anywhere between 15 seconds and 30 minutes, but this is across the board. I would like it to disable screen timeout only when one of the programs (that I currently develop) is running. Is this possible?

If this isn't possible, is it possible to disable it for only when a program is waiting for user input (via a dialog box)?

I wouldn't mind so much about the screen timeout itself, but once the screen times out, the device gets locked as well. :(

This is a developer answer, but I know that when you're coding an app for Android you have options that allow you to control the screen timeout. Google recommends that you use the user's preference by default and offer them actual options in the preferences of your app to change how your app affects the screen timeout, but technically you can do whatever you want. I have a number of apps (games, PowerAmp, etc.) that I allow permission to disable my screen timeout.

@an00b: Adobe PDF Reader only turn off the screen, but disabled screen lock unless the user presses the lock button explicitly. In their case, it is preferable to do it that way since users often read for long periods without making any input; but also, they turned off the screen to save battery (sometimes I fell asleep in the middle of reading). If your app is preventing screen timeout, then don't hold it for too long, users might went away thinking the screen will timeout then return half hour later with their battery drained (or they might fall asleep while operating the phone).
–
Lie RyanMar 31 '11 at 20:39

Your answer is excellent (+2 for that) but @Matthew's answer is what I was looking for in this forum. @Lie Ryan Thanks +1 for the tip.
–
an00bMar 31 '11 at 21:21