Пример #1
0
        public Everything()
        {
            var cp = new CreateParams
            {
                Caption = "PSEverything IPC Window",
                ClassName = "Static",
                ClassStyle = 0,
                Style = 0,
                ExStyle = 0,
                X = 0,
                Y = 0,
                Height = 1,
                Width = 1,
                Parent = IntPtr.Zero,
                Param = null
            };

            CreateHandle(cp);

            var cs = new ChangeFilterStruct
            {
                Size = (uint) Marshal.SizeOf(typeof (ChangeFilterStruct))
            };

            if (!Win32.ChangeWindowMessageFilterEx(Handle, WindowMessage.CopyData, ChangeWindowMessageFilterExAction.Allow, ref cs))
            {
                throw new Win32Exception(Marshal.GetLastWin32Error(), "Error allowing WM_COPYDATA mesasage from lower privilege processes.");
            }
        }
Пример #2
0
 internal static extern bool ChangeWindowMessageFilterEx(IntPtr hWnd, WindowMessage msg, ChangeWindowMessageFilterExAction action, ref ChangeFilterStruct changeInfo);
Пример #3
0
 internal static extern bool ChangeWindowMessageFilterEx(IntPtr hWnd, WindowMessage msg, ChangeWindowMessageFilterExAction action, ref ChangeFilterStruct changeInfo);