Waking from standby - powerbroadcasts.. (1 Viewer)

KXE_DENMARK

Portal Member
May 10, 2006
14
0
Aarhus Denmark
I am working on a plugin that is able to turn my TV on and off when the PC is going into / coming out of standby.
This does allready work.. sort of.

If I press the power button when the PC is in standby, I get a WM_POWERBROADCAST: 18, followed by a WM_POWERBROADCAST: 7
The latter has this constant: PBT_APMRESUMESUSPEND
I cant seem to find a constant for the first one, does anyone know the meaning of it ?

Also, I want to be able to distinct between when the PC wakes because it need to record a program (I use PVR scheduler) or when it is started manually.

The only difference I have found so far is that the WM_POWERBROADCAST: 7 is not fired when PVR scheduler wakes the PC.

Any thoughts ?
 

Smirnuff

Portal Pro
December 7, 2004
630
3
United Kingdom
I get a WM_POWERBROADCAST: 18

18 is PBT_APMRESUMEAUTOMATIC.

Here's the full list in case you don't have the Platform SDK installed:

Code:
#define PBT_APMQUERYSUSPEND             0x0000
#define PBT_APMQUERYSTANDBY             0x0001

#define PBT_APMQUERYSUSPENDFAILED       0x0002
#define PBT_APMQUERYSTANDBYFAILED       0x0003

#define PBT_APMSUSPEND                  0x0004
#define PBT_APMSTANDBY                  0x0005

#define PBT_APMRESUMECRITICAL           0x0006
#define PBT_APMRESUMESUSPEND            0x0007
#define PBT_APMRESUMESTANDBY            0x0008

#define PBTF_APMRESUMEFROMFAILURE       0x00000001

#define PBT_APMBATTERYLOW               0x0009
#define PBT_APMPOWERSTATUSCHANGE        0x000A

#define PBT_APMOEMEVENT                 0x000B
#define PBT_APMRESUMEAUTOMATIC          0x0012

Can't help with latter question.

Cheers,
Smirnuff.
 

mzemina

Retired Team Member
  • Premium Supporter
  • February 23, 2005
    2,065
    14
    Tulsa, OK
    Home Country
    United States of America United States of America
    Smirnuff - Always nice to see your young face (and valuable information you provide) in the forums!
     

    Aquarius

    MP Donator
  • Premium Supporter
  • November 23, 2004
    347
    7
    NRW
    Home Country
    Germany Germany
    interesting plugin !

    Hi,
    sounds like a very interesting plugin !

    May I raise the question how you electrically want to get the TV on ? Do you want to switch power on or set some signal for the TV to recognize an external source ?

    TVs ( at least in Europe) have a so called SCART Adapter. There you have to put +5V on a certain pin and the TV switches to the external source.

    Are you intending to do such things ?

    Regards
    /Gerd
     

    KXE_DENMARK

    Portal Member
    May 10, 2006
    14
    0
    Aarhus Denmark
    Smirnuff: thanx I'll just have to look into it some more.

    Aquarius: I own a LG 32LX2 which have a serial (D sub9) connection. With this it is possible to command the TV to do most of the commands from the remote. It is possible to poll states of the TV as well. Quite cool actually (at least I think, as I'm a geek of nature :D ).

    Anybody can give me a hint as what to look for, to be able to distinct between manually wake and scheduled wake ?
     

    Aquarius

    MP Donator
  • Premium Supporter
  • November 23, 2004
    347
    7
    NRW
    Home Country
    Germany Germany
    Q

    I own a LG 32LX2 which have a serial (D sub9) connection.

    So you saying you are controlling COMx of HTPC with this plugin ?
    That's really cool and could be well extended !

    Sending commands to your - specific - TV seems to a bit propietary. Could I also switch the control lines of COMx (e.g. RTS /CTS ) ?

    Regards
    /Gerd
     

    Users who are viewing this thread


    Write your reply...
    Top Bottom