Solved

Screen Saver Setting Option

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 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…

744 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

16 Experts available now in Live!

Get 1:1 Help Now