/// <summary>
        /// Gets the current 'Ticks' on the performance counter
        /// </summary>
        /// <returns>Long indicating the number of ticks on the performance counter</returns>
        public static long QueryPerformanceCounter()
        {
            long perfcount;

            MyWindowsAPIWrapper.QueryPerformanceCounter(out perfcount);
            return(perfcount);
        }
        /// <summary>
        /// Gets the number of performance counter ticks that occur every second
        /// </summary>
        /// <returns>The number of performance counter ticks that occur every second</returns>
        public static long QueryPerformanceFrequency()
        {
            long freq;

            MyWindowsAPIWrapper.QueryPerformanceFrequency(out freq);
            return(freq);
        }
示例#3
0
            public void Dispose()
            {
                if (IsDisposed)
                {
                    return;
                }

                MyWindowsAPIWrapper.UnloadKeyboardLayout(Handle);
                IsDisposed = true;
            }
示例#4
0
 public bool PreFilterMessage(ref Message m)
 {
     if (BypassedMessages.Contains(m.Msg))
     {
         if (m.Msg == (int)WM.ACTIVATE)
         {
             if (m.WParam == IntPtr.Zero)
             {
                 OnDeactivate(EventArgs.Empty);
             }
             else
             {
                 OnActivated(EventArgs.Empty);
             }
         }
         m.Result = MyWindowsAPIWrapper.DefWindowProc(m.HWnd, m.Msg, m.WParam, m.LParam);
         return(true);
     }
     return(false);
 }
示例#5
0
 public KeyboardLayout(string keyboardLayoutID)
     : this(MyWindowsAPIWrapper.LoadKeyboardLayout(keyboardLayoutID, KLF_NOTELLSHELL))
 {
 }