Hi Ganesh,
To clarify what you're saying so we're on the same page. Yes if your application relies on GUI elements, such as sending keys to a visible window (can be hidden as well) then it will not work when the session is entirely in the background. For example, an executable that relies on task manager to execute it when the user is no longer logged on will not work.
There are several ways around this that I've found.
Make the application not rely on GUI elements, programs usually have some sort of command line console that you can work with, websites and webforms have the invoke web request with powershell which AutoIT has a version of.
Leave your session logged in. This may or may not work depending on your application, but leaving your profile logged in in the lock position will allow some GUI dependent executables to run without a problem. As for disconnecting, I have not had any success with it, although I am open to the possibility.
Get a virtual machine involved.
Also, instead of simply using the send function. I would recommend that you use the ControlSend function. In fact I recommend trying this out first. This is a sample from a working IE script I am using:
Local $hWnd = _IEPropertyGet($oIE, "hwnd")
_IEAction($oSubmit, "focus")
ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}")
ControlSend sends the keys directly to the control itself and doesn't rely on an application being in focus so that perhaps might help you in a combination of the above possibilities.
If you are intent on using control send, you could always use the AU3Info tool under Tools in SciTE to better scout out the controls.