Click here to Skip to main content
15,896,348 members
Articles / Desktop Programming / Win32

Overlay using raphook.dll

Rate me:
Please Sign up or sign in to vote.
4.00/5 (3 votes)
21 Sep 2008CPOL2 min read 41.2K   1.4K   12  
A OverlayMgr based on Ray Adam's raphook.dll
using System;
using OverlayMgr;
using OverlayWrapper;

namespace TimePlugin {
    /// <summary>
    /// Time Plugin
    /// </summary>
    [Serializable]
    public class TimePlugin : IPlugin {
        private bool active;
        protected bool m_ShowDate = false;
        protected bool m_ShowTime = true;

        ///<summary>
        /// Time
        ///</summary>
        public bool ShowTime {
            get { return m_ShowTime; }
            set { m_ShowTime = value; }
        }

        ///<summary>
        /// ShowDate
        ///</summary>
        public bool ShowDate {
            get { return m_ShowDate; }
            set { m_ShowDate = value; }
        }

        #region IPlugin Members

        public string Name {
            get { return "Time"; }
        }

        public string Description {
            get { return "Displays the current Time"; }
        }

        public bool Load() {
            return true;
        }

        public bool Unload() {
            return true;
        }

        public void ShowConfig() {
            new Settings(this).ShowDialog();
        }

        public bool Active {
            get { return active; }
            set { active = value; }
        }

        public void Tick() {
            if (ShowTime)
                Overlay.Data.CustomString += " " + DateTime.Now.ToLongTimeString();
            if (ShowDate)
                Overlay.Data.CustomString += " " + DateTime.Now.ToShortDateString();
        }

        #endregion
    }
}

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)



Comments and Discussions