none
Win xp screensaver problem RRS feed

  • Question

  • HI,

    I have a vb.net program that uses axmediaplayer to play a wmv file.

    I have a timer in this program that loads another form after 5 seconds.

    Everything works fine in the program except..

    On Win XP machines (only Win7 is fine) if screensaver starts, then my program starts (it's a scheduled task) my form doesn't show. Neither the first form or the second form.

    Any ideas? I'll attach the code. I tried send keys..:

    Imports WMPLib
    Imports System.Windows.Forms.SendKeys
    
    
    Public Class Form1
    
        Private Sub RectangleShape1_doubleClick(sender As Object, e As EventArgs) Handles RectangleShape1.MouseDoubleClick
            MsgBox(Environment.MachineName)
            '    For Each nic As System.Net.NetworkInformation.NetworkInterface In System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()
            '        If nic.OperationalStatus = Net.NetworkInformation.OperationalStatus.Up Then
    
    
            '            MessageBox.Show(String.Format("The MAC address of {0} is{1}{2}", nic.Description, Environment.NewLine, nic.GetPhysicalAddress()))
            '        End If
    
            '    Next
        End Sub
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
            SendKeys.Send("{DOWN}") 'kills screensaver if running - use only on winxp machines REMOVE this if win7 build
       
            Me.Width = 674
            Me.Height = 553
            Me.Label1.Height = 41
            Me.Label1.Width = 343
            Me.RectangleShape1.Height = 154
            Me.RectangleShape1.Width = 583
            Me.RectangleShape2.Height = 50
            Me.RectangleShape2.Width = 583
            Me.AxWindowsMediaPlayer1.Height = 416
            Me.AxWindowsMediaPlayer1.Width = 577
            Me.Panel1.Height = 147
            Me.Panel1.Width = 576
            Me.PictureBox1.Height = 41
            Me.PictureBox1.Width = 115
            Me.PictureBox2.Height = 41
            Me.PictureBox2.Width = 115
    
            Label1.Location = New Point(168, 320)
            RectangleShape1.Location = New Point(44, 159)
            RectangleShape2.Location = New Point(44, 316)
            AxWindowsMediaPlayer1.Location = New Point(0, -133)
            Panel1.Location = New Point(48, 164)
            PictureBox1.Location = New Point(48, 320)
            PictureBox2.Location = New Point(508, 320)
    
    
    
            'If My.Application.IsNetworkDeployed Then
            '    Me.PictureBox1.ImageLocation = "\\WSIPR2\GSAP\yes.jpg"
            'End If
    
            Me.BackColor = Color.FromArgb(152, 0, 136)
            Me.TransparencyKey = Color.FromArgb(152, 0, 136)
            'black screen when running wmv from server until I changed this..
            'AxWindowsMediaPlayer1.URL = "\\WSIPR2\GSAP\g4s_new.wmv"
            AxWindowsMediaPlayer1.URL = "C:\program files\G4SGS\Time Reminder Installer\g4s_new.wmv"
            'If My.Application.IsNetworkDeployed Then
            '    AxWindowsMediaPlayer1.URL = My.Application.Info.DirectoryPath & "\resources\g4s_new.wmv"
            'End If
            'AxWindowsMediaPlayer1.URL = Application.StartupPath & "\g4s_new.wmv"
            RectangleShape2.Visible = False
            Label1.Visible = False
            PictureBox1.Visible = False
            PictureBox2.Visible = False
            'If My.Application.IsNetworkDeployed Then
            '    PictureBox1.ImageLocation = My.Application.Info.DirectoryPath & "\resources\yes.jpg"
            'End If
            'If My.Application.IsNetworkDeployed Then
            '    PictureBox1.ImageLocation = My.Application.Info.DirectoryPath & "\resources\no.jpg"
            'End If
            ''when using 'advanced installer for setup/delpoy - below must use program files (x86) for 64bit installs
            '32 bit installs go to program files
            ' - build application then point to sln - program won't run like this black screen but used for installer
            PictureBox1.ImageLocation = "C:\program files\G4SGS\Time Reminder Installer\yes.jpg"
            'PictureBox1.Image = My.Resources.yes
            'PictureBox2.Image = My.Resources.no
            'AxWindowsMediaPlayer1.URL = My.Resources.g4s_new
            PictureBox2.ImageLocation = "C:\program files\G4SGS\Time Reminder Installer\no.jpg"
    
    
    
    
        End Sub
    
    
    
            Dim timercount As Integer = 10
            Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
                timercount = timercount - 1
                If timercount = 5 Then
                    RectangleShape2.Visible = True
                    Label1.Visible = True
                    PictureBox1.Visible = True
                    PictureBox2.Visible = True
                    'close if left running 
                End If
                If timercount > 20 Then
                    Me.Close()
                    End
    
                End If
    
            End Sub
    
            Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
                Timer1.Enabled = False
                Me.Close()
            End Sub
    
            Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
                Timer1.Enabled = False
                Shell("\\wsipr2\gsap\wsites\TES.exe", 1)
                Me.Close()
            End Sub
        End Class
    


    qeqw

    Monday, January 14, 2013 9:06 PM

Answers

  • You could try this program from Codeplex called Mouse Jiggler. I believe it's in C# but you could convert the source to VB I suppose if it isn't copyrighter or whatever.

    Mouse Jiggler is a very simple piece of software whose sole function is to "fake" mouse input to Windows, and jiggle the mouse pointer back and forth.

    Useful for avoiding screensavers or other things triggered by idle detection that, for whatever reason, you can't turn off any other way; or as a quick way to stop a screensaver activating during an installation or when monitoring a long operation without actually having to muck about with the screensaver settings.

    http://mousejiggler.codeplex.com/


    You've taught me everything I know but not everything you know.

    Wednesday, January 16, 2013 2:24 AM
  • In addition to trying Monkeyboy's idea, please view this thread:

    http://www.vbforums.com/showthread.php?599936-RESOLVED-Enable-Disable-Screen-Saver-in-Windows-7


    “If you want something you've never had, you need to do something you've never done.”

    Don't forget to mark helpful posts and answers ! Answer an interesting question? Write a new article about it! My Articles
    *This post does not reflect the opinion of Microsoft, or its employees.

    Sunday, January 20, 2013 9:52 AM
    Moderator

All replies

  • I don't have XP so I can't claim to know any fix, but can you try with a blank program with just a blank interface popup, something where load isn't modified, try bringing a messagebox up instead & see what happens in the same circumstances?

    I mean if the screensaver messes with it, and your wanting to kill it anyways so the screensaver doesn't mess with your app(like in your code, you tried sendkeys to get rid of the screensaver) so that's just a thought? why are you not disabling it?

    Or if your app is intentionally meant to get rid of the screensaver and focus on the app for whatever reason...

    Anyways I am just trying to gage whether the app is failing to function at all(call load or anything else) or see what it fails to call, and how to fix it...

    Also, under these circumstances I assume you made sure it was made to open at all, and that the screensaver didn't stop it completely? (the app is started in task manager but isn't displayed?)

    Monday, January 14, 2013 10:35 PM
  • I don't have XP so I can't claim to know any fix, but can you try with a blank program with just a blank interface popup, something where load isn't modified, try bringing a messagebox up instead & see what happens in the same circumstances?

    I mean if the screensaver messes with it, and your wanting to kill it anyways so the screensaver doesn't mess with your app(like in your code, you tried sendkeys to get rid of the screensaver) so that's just a thought? why are you not disabling it?

    Or if your app is intentionally meant to get rid of the screensaver and focus on the app for whatever reason...

    Anyways I am just trying to gage whether the app is failing to function at all(call load or anything else) or see what it fails to call, and how to fix it...

    Also, under these circumstances I assume you made sure it was made to open at all, and that the screensaver didn't stop it completely? (the app is started in task manager but isn't displayed?)

    I think the timer doesn't work when the screensaver is running..basically the form doesn't load. BUt only when screensaver fires first. If program loads first it's fine.

    And it's just the form itself that doens't load. Wierd part is in win7 everything works great.


    qeqw

    Tuesday, January 15, 2013 1:51 PM
  • You could try this program from Codeplex called Mouse Jiggler. I believe it's in C# but you could convert the source to VB I suppose if it isn't copyrighter or whatever.

    Mouse Jiggler is a very simple piece of software whose sole function is to "fake" mouse input to Windows, and jiggle the mouse pointer back and forth.

    Useful for avoiding screensavers or other things triggered by idle detection that, for whatever reason, you can't turn off any other way; or as a quick way to stop a screensaver activating during an installation or when monitoring a long operation without actually having to muck about with the screensaver settings.

    http://mousejiggler.codeplex.com/


    You've taught me everything I know but not everything you know.

    Wednesday, January 16, 2013 2:24 AM
  • In addition to trying Monkeyboy's idea, please view this thread:

    http://www.vbforums.com/showthread.php?599936-RESOLVED-Enable-Disable-Screen-Saver-in-Windows-7


    “If you want something you've never had, you need to do something you've never done.”

    Don't forget to mark helpful posts and answers ! Answer an interesting question? Write a new article about it! My Articles
    *This post does not reflect the opinion of Microsoft, or its employees.

    Sunday, January 20, 2013 9:52 AM
    Moderator