Solved

RUN APPLICATION from SCREEN SAVER in Win2K

Posted on 2001-07-12
10
177 Views
Last Modified: 2008-03-10
I need to run an application from screen saver. When screen saver exists I use this code to launch application.

STARTUPINFO si;
PROCESS_INFORMATION ProcessInformation;
si.cb = sizeof(STARTUPINFO);
si.lpReserved = NULL;
si.lpTitle = NULL;
si.lpDesktop = _T("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(lpApplicationName, lpszCmdLine, NULL, NULL, FALSE,
                   0, NULL, NULL, &si, &ProcessInformation))
{
    ::CloseHandle(ProcessInformation.hProcess);
    ::CloseHandle(ProcessInformation.hThread);
}

But problem is, this code launch application successfully on Win NT, but I can'tsee launched application on desktop of Win 2k. Another important thing is that when I shutdown my Win 2k system then while shuting down I can see that launched application. I don't know on which desktop this Win 2k launch application.

Please help me in his problem, as I m not getting any idea, as the code is working fine on NT, but is creating problem on Win 2k.

Waiting for reply!
Thanx.
0
Comment
Question by:haider
10 Comments
 

Expert Comment

by:tianyu
ID: 6276133
I ran your code with following changes:
if (::CreateProcess(NULL, TEXT("NOTEPAD readme.txt"), NULL, NULL, FALSE,
                  0, NULL, NULL, &si, &ProcessInformation))
Nothing wrong.
2K with service pack 1; VC6.0 with service pack 4; last platform SDK header files and lib.

Did you try it without screen saver?
0
 

Author Comment

by:haider
ID: 6276281
yes, without screen saver it works fine, but problem occured only in case of screen saver.
0
 

Expert Comment

by:tianyu
ID: 6279255
need to check screen saver
0
 

Author Comment

by:haider
ID: 6279856
If you need a sample screen saver code then I can send you that.
0
 

Expert Comment

by:tianyu
ID: 6279907
sure. Send it to t_yu72@hotmail.com
One more question: it doesn't work for all screen savers or for this one only?
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:haider
ID: 6280086
Screen Saver is on its way, please check your mail. Also I have checked this thing with many other sample screen saver codes but it doesn't work for any of them, but it works fine for NT and 9x.
0
 

Expert Comment

by:tianyu
ID: 6288599
error return from createprocess is "access denied" when the screen saver is invoked by 2K or scheduled tasks. while the createprocess is successful when screen saver is invoked by double clicks. Should look into the security settings or something.
0
 

Author Comment

by:haider
ID: 6288739
yeah, looks like to set security settings, but can you help me in doing this, if you can. Also have you tried it on NT or 9x, it will work fine for NT and 9x.
0
 
LVL 11

Expert Comment

by:griessh
ID: 6828182
I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. Unless there is objection or further activity,  I will suggest to refund the points and PAQ at zero points since nobody had a satisfying answer for you.

The link to the Community Support area is: http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 6845902
Points reduced to 0 and placed in PAQ.

Thank you
E-E Moderator
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now