Zzz – Rev 1

Subversion Repositories:
Rev:
using System;
using System.Runtime.InteropServices;
using System.Text;

namespace Zzz.Utilities
{
    public class Natives
    {
        #region Static Fields and Constants

        public const int HWND_BROADCAST = 0xffff;

        public static readonly int WM_SHOWME = RegisterWindowMessage("WM_SHOWME");

        #endregion

        #region Public Events & Delegates

        public delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);

        #endregion

        #region Public Methods

        [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);

        [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
        public static extern int GetWindowTextLength(IntPtr hWnd);

        [DllImport("user32.dll")]
        public static extern bool EnumWindows(EnumWindowsProc enumProc, IntPtr lParam);

        [DllImport("user32")]
        public static extern bool PostMessage(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam);

        [DllImport("user32.dll", EntryPoint = "RegisterWindowMessageW", SetLastError = true)]
        public static extern int RegisterWindowMessage(string lpString);

        #endregion
    }
}

Generated by GNU Enscript 1.6.5.90.