?
Solved

RUN APPLICATION from SCREEN SAVER in Win2K

Posted on 2001-07-12
10
Medium Priority
?
185 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
  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 …
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.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

777 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