Setting ScreenSaver

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christopher Burr

    Setting ScreenSaver


    I'm trying to set the user's screensaver in the .NET world...

    In Win32 I could use a combination of setting the screen saver name via the
    registry and then setting the time and active status using
    SystemParameter sInfo. And the system would use the new settings.

    Now that I'm trying to do it in .NET, I found that SystemParameter sInfo does
    not exist. I also found I can detect when the screensaver settings have
    been changed, but what I cannot find out is how to cause the system to know
    that the screensaver settings have changed...

    Anyone have any ideas?

    --
    Chris Burr
    cburr@kcc.com



  • Shishir Kumar Mishra

    #2
    Re: Setting ScreenSaver

    You still can use those features through P/Invoke.

    Add namespace System.Runtime. InteropServices in your code and then declare
    [DllImport("user 32", CharSet=CharSet .Auto)]
    unsafe public static extern short SystemParameter sInfo (int uiAction, int
    uiParam, int* pvParam, int fWinIni);


    HTH
    Shishir Kumar Mishra
    Agni Software (P) Ltd.


    "Christophe r Burr" <cburr@kcc.co m> wrote in message
    news:%23J%23HOg o5DHA.2576@TK2M SFTNGP11.phx.gb l...[color=blue]
    >
    > I'm trying to set the user's screensaver in the .NET world...
    >
    > In Win32 I could use a combination of setting the screen saver name via[/color]
    the[color=blue]
    > registry and then setting the time and active status using
    > SystemParameter sInfo. And the system would use the new settings.
    >
    > Now that I'm trying to do it in .NET, I found that SystemParameter sInfo[/color]
    does[color=blue]
    > not exist. I also found I can detect when the screensaver settings have
    > been changed, but what I cannot find out is how to cause the system to[/color]
    know[color=blue]
    > that the screensaver settings have changed...
    >
    > Anyone have any ideas?
    >
    > --
    > Chris Burr
    > cburr@kcc.com
    >
    >
    >[/color]


    Comment

    • Christopher Burr

      #3
      Re: Setting ScreenSaver

      Yea, was just hoping that I could avoid going to unmanaged code.

      --
      Chris Burr
      cburr@kcc.com


      "Shishir Kumar Mishra" <shishir@agniso ft.com> wrote in message
      news:uX19E3u5DH A.2432@TK2MSFTN GP10.phx.gbl...[color=blue]
      > You still can use those features through P/Invoke.
      >
      > Add namespace System.Runtime. InteropServices in your code and then[/color]
      declare[color=blue]
      > [DllImport("user 32", CharSet=CharSet .Auto)]
      > unsafe public static extern short SystemParameter sInfo (int uiAction, int
      > uiParam, int* pvParam, int fWinIni);
      >
      >
      > HTH
      > Shishir Kumar Mishra
      > Agni Software (P) Ltd.
      > www.agnisoft.com
      >
      > "Christophe r Burr" <cburr@kcc.co m> wrote in message
      > news:%23J%23HOg o5DHA.2576@TK2M SFTNGP11.phx.gb l...[color=green]
      > >
      > > I'm trying to set the user's screensaver in the .NET world...
      > >
      > > In Win32 I could use a combination of setting the screen saver name via[/color]
      > the[color=green]
      > > registry and then setting the time and active status using
      > > SystemParameter sInfo. And the system would use the new settings.
      > >
      > > Now that I'm trying to do it in .NET, I found that SystemParameter sInfo[/color]
      > does[color=green]
      > > not exist. I also found I can detect when the screensaver settings have
      > > been changed, but what I cannot find out is how to cause the system to[/color]
      > know[color=green]
      > > that the screensaver settings have changed...
      > >
      > > Anyone have any ideas?
      > >
      > > --
      > > Chris Burr
      > > cburr@kcc.com
      > >
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Maniaque |CIA|

        #4
        Re: Setting ScreenSaver

        On Fri, 30 Jan 2004 07:17:18 -0600, Christopher Burr <cburr@kcc.co m> wrote:
        [color=blue]
        > Yea, was just hoping that I could avoid going to unmanaged code.
        >[/color]

        And what's the problem? Use the registry and make it up through it!

        --
        .... blood, sugar, sex, magic ...
        CIA = Caught In Action programmer

        Comment

        • Christopher Burr

          #5
          Re: Setting ScreenSaver

          Only problem then is that the effects don't take place until the next login
          =(

          --
          Chris Burr
          cburr@kcc.com


          "Maniaque |CIA|" <cape[a]fromru[dot]com> wrote in message
          news:opr2lb7bgr 4xtn5a@msnews.m icrosoft.com...[color=blue]
          > On Fri, 30 Jan 2004 07:17:18 -0600, Christopher Burr <cburr@kcc.co m>[/color]
          wrote:[color=blue]
          >[color=green]
          > > Yea, was just hoping that I could avoid going to unmanaged code.
          > >[/color]
          >
          > And what's the problem? Use the registry and make it up through it!
          >
          > --
          > ... blood, sugar, sex, magic ...
          > CIA = Caught In Action programmer[/color]


          Comment

          Working...