?
Solved

Screensaver closing issue!!

Posted on 2003-03-18
9
Medium Priority
?
158 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
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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

621 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