?
Solved

Screensaver closing issue!!

Posted on 2003-03-18
9
Medium Priority
?
157 Views
Last Modified: 2010-05-01
Guys,

We have created a screensaver, which upon mouse move shows some options to the user and launches a URL in the available browser based on user selection. Once the browser is opened, the screensaver should close leaving browser open.

This was created in visual basic using ShellExecute to open browser.

When I run the screensaver manually (by double clicking the scr file), the above interaction works perfectly.

However, when I allow the screensaver to comeup by itself after its due wait time specified, the following happens:

- Screensaver is launched
- Upon mousemove, the user is shown URL options
- User selects a specific URL
- Browser is opened with the given URL. SO FAR SO GOOD

However, when screensaver closes and along with it the BROWSER IS CLOSED AS WELL.

The hunch is that whenever the windows screensaver process is launched by windows, all applications within it (in our case the screensaver and potentially the browser instance that we opened) become its children. When the application is closed, it tells windows to close its screensaver process. When Windows fires the close screensaver, our browser also gets close.

Please confirm if my above theory makes sense. If yes, what could be a good workaround. Is there a way to tell screensaver process to not bother closing itself since we are taking care of it??

This is a very high priority project for us, please help.

Thanks
0
Comment
Question by:gogetters123
[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
9 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8160691
sub OpenBrowser()
dim ie as object
set ie=createobject("Internetexplorer.application")

with ie
     .navigate "URL_goes_here"
     .visible = true
end with
unload me
end sub
0
 
LVL 2

Expert Comment

by:saurabhgupta
ID: 8160729
Are you passing the hwnd of the screensaver in ShellExecute. If yes, try putting the hwnd as 0.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8160762
if it doesn't meets your requirement:

sub OpenBrowser()
shell "start " & "http://www.google.com",vbnormal
unload me
end sub
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!

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8160799
or:
Sub OpenBrowser()
Dim ws As Object
Set ws = CreateObject("Wscript.Shell")
ws.run "www.google.com"
Unload Me
End Sub
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 8165224
Hi gogetters123,

When the screensaver is launched, it actually creates a new virtual desktop for the screensaver and asssociated processes to run in. This is not the same as your existing desktop. Therefore when you launch the browser, it is launched on the screensaver's desktop and not your normal interactive desktop. When you close the screensaver, the desktop is destroyed and any applications running on that desktop are either terminated or possibly will continue running on that desktop but not be visible to your normal interactive session.

The trick is to ensure that the browser session is started on the default desktop. At the moment I don't have a suitable solution to hand but I am sure that one can be found.

Tim Cottee MCSD, MCDBA, CPIM
http://www.timcottee.tk 

Brainbench MVP for Visual Basic
http://www.brainbench.com

Experts-Exchange Advisory Board Member
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8166155
Following Tim Cottee's comments:
what happens if you use ShellExecute with the hwnd returned by GetDesktopWindow API?
0
 

Expert Comment

by:CleanupPing
ID: 8899980
gogetters123:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 8957264
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

-->PAQ - with points refunded

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

GPrentice00
EE Cleanup Volunteer
0
 

Accepted Solution

by:
YensidMod earned 0 total points
ID: 9023684
Question is PAQ'd and no points refunded.

YensidMod
Community Support Moderator @Experts Exchange
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month9 days, 1 hour left to enroll

764 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