To make an application run in the background just change the setting in the setting tab of the window at the right (in project view mode) and check hidden for the display setting.
It sounds like you are trying to make your own macro with darkbasic. I have found a nice open-source macro program that you program your own macros and it will run them. You might want to check it out at
http://www.autohotkey.com/.
When life hands you lemons go buy some oranges to make orange juice, and stop expecting everything to be given to you.