Click here to Skip to main content
15,881,715 members
Articles / Desktop Programming / WTL

Windows Media Player Standby Plug-in

Rate me:
Please Sign up or sign in to vote.
4.47/5 (13 votes)
27 May 2005CPOL4 min read 208.8K   7.9K   32  
Media Player plug-in turning computer off when media ends
In this article, you will see my implementation which is similar to the TV's Sleep timer function. You will also see my Media Player plug-in which instead of turning Media Player off after the specified interval of time turns the PC off when the media ends.
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE DISCARDABLE 
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE DISCARDABLE 
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE DISCARDABLE 
BEGIN
    "\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// REGISTRY
//

IDR_REG_UIPLUGIN        REGISTRY DISCARDABLE    "uiplugin.rgs"
IDR_REG_BKPLUGIN        REGISTRY DISCARDABLE    "bkplugin.rgs"

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_FORMVIEW DIALOG DISCARDABLE  0, 0, 218, 59
STYLE WS_CHILD
FONT 8, "Tahoma"
BEGIN
    CONTROL         105,IDC_IMG,"Static",SS_BITMAP,7,7,60,32
    CONTROL         113,IDC_LED,"Static",SS_BITMAP | SS_REALSIZEIMAGE,11,44,
                    4,4
    LTEXT           "Start Timer",IDC_STARTSTOP,18,42,53,10,SS_NOTIFY
    LTEXT           "4",IDC_ARROW1,75,18,8,10
    LTEXT           ".",IDC_TYPE,86,17,96,10,SS_NOTIFY
    LTEXT           "4",IDC_ARROW2,75,32,8,10
    LTEXT           ".",IDC_VOLUME,86,31,96,10,SS_NOTIFY
    RTEXT           "About",IDC_ABOUT,182,44,29,8,SS_NOTIFY
END


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE 
BEGIN
    IDD_FORMVIEW, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 211
        VERTGUIDE, 75
        VERTGUIDE, 86
        VERTGUIDE, 182
        TOPMARGIN, 7
        BOTTOMMARGIN, 52
    END
END
#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_TIMER               ICON    DISCARDABLE     "res\\timer.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//

IDB_TIMER               BITMAP  DISCARDABLE     "res\\timer.bmp"
IDB_LEDGREEN            BITMAP  DISCARDABLE     "res\\ledg.bmp"
IDB_LEDRED              BITMAP  DISCARDABLE     "res\\ledr.bmp"

#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,0,1
 PRODUCTVERSION 1,0,0,1
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x40004L
 FILETYPE 0x2L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "Comments", "\0"
            VALUE "CompanyName", "Epygi Labs Am Llc\0"
            VALUE "FileDescription", "mpst\0"
            VALUE "FileVersion", "1, 0, 0, 1\0"
            VALUE "InternalName", "mpst\0"
            VALUE "LegalCopyright", "� Armen Hakobyan, 2005\0"
            VALUE "LegalTrademarks", "\0"
            VALUE "OriginalFilename", "mpst.dll\0"
            VALUE "PrivateBuild", "\0"
            VALUE "ProductName", "Epygi Labs Am Llc mpst\0"
            VALUE "ProductVersion", "1, 0, 0, 1\0"
            VALUE "SpecialBuild", "\0"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END

#endif    // !_MAC


/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE DISCARDABLE 
BEGIN
    IDS_UI_FRIENDLYNAME     "Armen Hakobyan's Sleep Timer"
    IDS_UI_DESCRIPTION      "Description of Armen Hakobyan's Sleep Timer"
    IDS_BK_FRIENDLYNAME     "Armen Hakobyan's Background Sleep Timer"
    IDS_BK_DESCRIPTION      "Description of Armen Hakobyan's Background Sleep Timer"
    IDP_LOADBKPLUGIN        "Media Player has not initialized yet or the background plugin is not loaded!\nTo load the background plugin, go to the Tools->Options menu, then click\nthe Plug-ins tab, select category - background, and load the plugin."
    IDS_ABOUT_TEXT          "� Armen Hakobyan, 2005\nhttp://www.codeproject.com"
END

STRINGTABLE DISCARDABLE 
BEGIN
    IDC_TYPE                "Shutdown type. May be one of the following:\nShutdown,  Logoff, Hybernate, Suspend"
    IDC_VOLUME              "Specifies, whether to mute volume on shutdown or not."
    IDC_ABOUT               "Display information about this plugin. "
    IDC_STARTSTOP           "Start or Stop the standby timer."
END

#endif    // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) SafeNet Inc
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions