Solved

Screen Saver Setting Option

Posted on 1999-01-24
4
139 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now