Solved

RUN APPLICATION from SCREEN SAVER in Win2K

Posted on 2001-07-12
10
179 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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
 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C++ assignment question 7 196
C++ get user from AD  (VS6) 7 72
Dynamically allocate memory 9 58
Embarcadero C++ builder XE10.1 Berlin TRegistry declaration 1 25
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
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 learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

813 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

13 Experts available now in Live!

Get 1:1 Help Now