Solved

RUN APPLICATION from SCREEN SAVER in Win2K

Posted on 2001-07-12
10
181 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

763 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