Solved

Screen Saver Setting Option

Posted on 1999-01-24
4
145 Views
Last Modified: 2010-05-03
I have created my own screen saver in VB 5.0 for NT 4.0 and win '95.  

From the Display properties i could set my Screen Saver. When the user presses the settings... it calls the screen saver .SCR file with /c option which calls the settings form. When the settings form is open i don't want the user to click on the display properties window.  I tried to open the setting form as settingfrm.show vbModal.  But this doesn't work.  Can anyone help me solve this problem.  I have also tried the setWindowsPos  API which makes this window TOPMOST, but still i am able to close the Display Properties window.
0
Comment
Question by:raguram
[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
4 Comments
 
LVL 3

Expert Comment

by:Foyal
ID: 1470464
did you try calling the settings form as vbModal? (I don't even know if it can be... just a thought)
0
 

Author Comment

by:raguram
ID: 1470465
I tried that also but didn't work
0
 

Expert Comment

by:Fantym
ID: 1470466
Are you trying to prevent the user from testing the screen saver while the settings are open?

0
 
LVL 3

Accepted Solution

by:
Michelt earned 50 total points
ID: 1470467
This is what I use in My Screen Saver. It works great. (the only difference is I got a Custom Properties form.

Sub Main()
    Dim StartType$
    xPixel = Screen.TwipsPerPixelX
    yPixel = Screen.TwipsPerPixelY
   
    StartType = UCase(Left$(Command, 2))
    If StartType = "" Then
        StartType = "/C"
    End If
    Select Case StartType
        Case "/C" ' Configuration
            Configuration.Show
        Case "/S" ' Regular Startup
            If CheckUnique("Screen Saver Main Form") = False Then
                Exit Sub
            End If
            MainForm.Show
        Case "/P" ' Properties (Treated as Configuration)
            Configuration.Show
    End Select
End Sub
Function CheckUnique%(FormCaption$) ' Because prev.instance sometimes doesn't work
    Dim HandleWin&
    HandleWin = FindWindow(vbNullString, FormCaption)
    If HandleWin = 0 Then
        CheckUnique = True
    Else
        CheckUnique = False
    End If
End Function
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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
Course of the Month9 days, 12 hours left to enroll

624 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