Tom's Hardware > Forum > Windows XP > Windows XP General Discussion > Starting application in windows xp from service to the log..

Starting application in windows xp from service to the log..

Forum Windows XP : Windows XP General Discussion - Starting application in windows xp from service to the log..

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

Archived from groups: microsoft.public.windowsxp.basics (More info?)

 

Hello,

I have one service that will get start on the start of window. Now I am
using one normal windows application to show service's messages to
user. Now I want to start this normal windows application (if it is not
running already) when service need to show some messages to user. I am
using following code to do that in service.

STARTUPINFO si;
PROCESS_INFORMATION ProcessInformation;

si.cb = sizeof(STARTUPINFO);
si.lpReserved = NULL;
si.lpTitle = NULL;
si.lpDesktop = "WinSta0\\Default";
si.dwX = si.dwY = si.dwXSize = si.dwYSize = 0L;
si.dwFlags = 0;;
si.wShowWindow = SW_SHOW;
si.lpReserved2 = NULL;
si.cbReserved2 = 0;
if (CreateProcess(NULL, "D:\\ServiceMessageDialog.exe", NULL, NULL,
FALSE,
0, NULL, NULL, &si, &ProcessInformation))
{
CloseHandle(ProcessInformation.hProcess);
CloseHandle(ProcessInformation.hThread);
}

The problem with this is in case of windows 2000 it starts the exe
correctly. In case of XP when 2 or more user is logged in then above
code start the exe in the first logged in user. Now I have a handle to
the session in which I need to start normal windows application to show
service's messages but I don't know how to use this session handle to
start a process in that session. Any help is appreciated.

Thanks in advance,
Bhavesh

Sponsored Links
Register or log in to remove.
Tom's Hardware > Forum > Windows XP > Windows XP General Discussion > Starting application in windows xp from service to the log..
Go to:

There are 1081 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them