Ejemplo n.º 1
0
        /// <summary>
        /// Sends timer tick message to service
        /// </summary>
        public static void TimerTick()
        {
            IntPtr  hwnd = VKnotifications.FindWindow(IntPtr.Zero, ServiceName);
            Message msg  = Message.Create(hwnd, WM_TIMER_TICK, (IntPtr)0, (IntPtr)0);

            MessageWindow.SendMessage(ref msg);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sends message to the message window and return imidiately
        /// </summary>
        /// <param name="windowName">Name of the window</param>
        /// <param name="message">Windows message</param>
        /// <param name="Wparam">W parametr</param>
        /// <param name="Lparam">L parametr</param>
        public static void PostMessage(string windowName, int message, int Wparam, int Lparam)
        {
            IntPtr  hwnd = VKnotifications.FindWindow(IntPtr.Zero, windowName);
            Message msg  = Message.Create(hwnd, message, (IntPtr)Wparam, (IntPtr)Lparam);

            MessageWindow.PostMessage(ref msg);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Sends quit message to service
        /// </summary>
        public static void StopService()
        {
            IntPtr hwnd = VKnotifications.FindWindow(IntPtr.Zero, ServiceName);

            if (hwnd != IntPtr.Zero)
            {
                Message msg = Message.Create(hwnd, WM_QUIT_SERVICE, (IntPtr)0, (IntPtr)0);
                MessageWindow.SendMessage(ref msg);
            }
        }