Announcement

Collapse
No announcement yet.

Standby/Hibernate/Resume events

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Standby/Hibernate/Resume events

    Any chance of having them fired by CF rather than using the servicebase class ?

    /M

  • #2
    Maybe I was a bit unclear ?

    As far as I know there isn't any way to tell when CF is shuting down and when CF have resumed (fully) from a suspend/hibernate state.
    Yes, you could use the servicebase class to monitor Windows, but since CF allready handles suspend/resume it would be nice to have an CF event like "CF_Suspend" and "CF_Resumed".

    Could you add this to the SDK, David, please ?

    /M

    Comment


    • #3
      Originally posted by Maximus
      Maybe I was a bit unclear ?

      As far as I know there isn't any way to tell when CF is shuting down and when CF have resumed (fully) from a suspend/hibernate state.
      Yes, you could use the servicebase class to monitor Windows, but since CF allready handles suspend/resume it would be nice to have an CF event like "CF_Suspend" and "CF_Resumed".

      Could you add this to the SDK, David, please ?

      /M
      It's already there... Check out CF_Event_powerModeChanged event....

      david
      __________________
      CENTRAFUSE http://www.centrafuse.com
      01 Jeep Cherokee Sport 4x4 Installed
      M10000/512Mb/20GB, Lilliput 7", Holux GM-210

      Comment


      • #4
        Originally posted by veetid
        It's already there... Check out CF_Event_powerModeChanged event....

        Look at that !
        And yet I searched... so how do I tell if it's suspending or resuming ?

        /Magnus

        Comment


        • #5
          Originally posted by Maximus
          Look at that !
          And yet I searched... so how do I tell if it's suspending or resuming ?

          /Magnus
          A parameter is passed into the function... It will let you know if the machine is suspended or resuming...

          david
          __________________
          CENTRAFUSE http://www.centrafuse.com
          01 Jeep Cherokee Sport 4x4 Installed
          M10000/512Mb/20GB, Lilliput 7", Holux GM-210

          Comment


          • #6
            You make me feel really stupid

            And those parameters are ?

            I downloaded the lastes SDK-help file a couple of days ago, and in that file I can't find those parameters.

            Clicking on "PowerModeChangedEventArgs" just ends up in a 404.
            "The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings."


            Many thanks,

            /M

            Comment


            • #7
              Originally posted by Maximus
              You make me feel really stupid

              And those parameters are ?

              I downloaded the lastes SDK-help file a couple of days ago, and in that file I can't find those parameters.

              Clicking on "PowerModeChangedEventArgs" just ends up in a 404.
              "The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings."


              Many thanks,

              /M
              That Args class is a Microsoft one that I pass...

              http://msdn2.microsoft.com/en-us/lib...eventargs.aspx

              That link was suppose to link to the online msdn... There is a mode property on the class that has what you need...

              http://msdn2.microsoft.com/en-us/lib...owermodes.aspx

              Resume
              StatusChange
              Suspend

              david
              __________________
              CENTRAFUSE http://www.centrafuse.com
              01 Jeep Cherokee Sport 4x4 Installed
              M10000/512Mb/20GB, Lilliput 7", Holux GM-210

              Comment


              • #8
                Thanks a million, if you'd be here I'd give you a kiss

                /M

                Comment


                • #9
                  Sorry to bother you again, but since I'm quite new to C# I don't know if there's a problem with CF or it's just the simple fact that I'm a bit thick

                  When I try to assign the "powermode changed" event to a new event handler I get an error:

                  this.CF_Event_powerModeChanged += new EventHandler(iBUS_CF_Event_powerModeChanged);

                  "Cannot implicitly convert type 'System.EventHandler' to 'Microsoft.Win32.PowerModeChangedEventHandler'"

                  Many thanks,

                  /M

                  Comment


                  • #10
                    Originally posted by Maximus
                    Sorry to bother you again, but since I'm quite new to C# I don't know if there's a problem with CF or it's just the simple fact that I'm a bit thick

                    When I try to assign the "powermode changed" event to a new event handler I get an error:

                    this.CF_Event_powerModeChanged += new EventHandler(iBUS_CF_Event_powerModeChanged);

                    "Cannot implicitly convert type 'System.EventHandler' to 'Microsoft.Win32.PowerModeChangedEventHandler'"

                    Many thanks,

                    /M
                    Check out http://www.centrafuse.com/api for details on all the types... Power event mode should be declared as:

                    this.CF_Event_powerModeChanged += new Microsoft.Win32.PowerModeChangedEventHandler(power ModeChanged);

                    And the method would be like following:

                    private void powerModeChanged(object sender, Microsoft.Win32.PowerModeChangedEventArgs e){
                    }

                    Then you will want to check parameters on the Args e to determine whether it is a Suspend or Resume event...

                    david
                    __________________
                    CENTRAFUSE http://www.centrafuse.com
                    01 Jeep Cherokee Sport 4x4 Installed
                    M10000/512Mb/20GB, Lilliput 7", Holux GM-210

                    Comment

                    Working...
                    X