Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

RUN APPLICATION from SCREEN SAVER in Win2K

Posted on 2001-07-12
10
Medium Priority
?
186 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
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.

609 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