Sign Up!
Welcome to The Grim Admin
Monday, May 22 2017 @ 07:18 PM EDT
 Forum Index >  Grim Admin Software and Scripts >  Screensaver Operations
 Re: 2 of 6 screens dim
   |  Printable Version
By: auctionsjeff (offline)  Friday, March 02 2012 @ 10:00 AM EST (Read 3276 times)  

I also wrote a dimming program, but it wasn't as fancy as a screen saver. It just checked system idle time until it was X, and then dimmed all the screens slowly (in stages), as a warning that your PC was about to lock.

Here is the code that I used to dim ALL screens no matter what: (couldn't get a for each to work due to a technicality)

PHP Formatted Code
    Sub PositionForm()
        Dim MinX As Int16
        Dim MaxX As Int16
        Dim MinY As Int16
        Dim MaxY As Int16
        For i = 0 To Screen.AllScreens.Count - 1
            With Screen.AllScreens(i).Bounds
                If .Location.X < MinX Then MinX = .Location.X
                If .Location.X + .Width > MaxX Then MaxX = .Location.X + .Width
                If .Location.Y < MinY Then MinY = .Location.Y
                If .Location.Y + .Height > MaxY Then MaxY = .Location.Y + .Height
            End With
        Debug.Print("Total Area:  " & MinX & ", " & MinY & " to " & MaxX & ", " & MaxY)
        Me.Left = MinX
        Me.Top = MinY
        Me.Width = MaxX - MinX
        Me.Height = MaxY - MinY
        Me.Visible = False
    End Sub

I also attached a screenshot so you could see what I meant.

Forum Grim Hatchling
Grim Hatchling

Registered: 03/01/12
Posts: 1

Profile Email    
By: Admin (offline)  Thursday, March 29 2012 @ 11:27 AM EDT  

Interesting. I took a look at the attached image. It might be because your primary screen (with the task bar) is in the middle. It's possible the code I've written assumes that the primary screen is the first or maybe the left-most screen. I'll have to revisit it. Unfortunately, I don't have more than one monitor nor a video card with more than one display output. The best I can do is connect my laptop to a monitor and get two screens.

Thanks for the code as well. I'll put this issue on the known issues list and will keep the code in mind when I am able to look at it.

Forum Admin

Registered: 07/28/09
Posts: 14

Profile Email Website  

 All times are EDT. The time is now 07:18 pm.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic w/ New Post Sticky Topic w/ New Post
Locked Topic w/ New Post Locked Topic w/ New Post
View Anonymous Posts 
Able to Post 
HTML Allowed 
Censored Content