public static Standard.HRESULT ChangeWindowMessageFilterEx(IntPtr hwnd, Standard.WM message, Standard.MSGFLT action, out Standard.MSGFLTINFO filterInfo) { filterInfo = Standard.MSGFLTINFO.NONE; if (!Standard.Utility.IsOSVistaOrNewer) { return(Standard.HRESULT.S_FALSE); } if (!Standard.Utility.IsOSWindows7OrNewer) { if (!_ChangeWindowMessageFilter(message, action)) { return((Standard.HRESULT)Standard.Win32Error.GetLastError()); } return(Standard.HRESULT.S_OK); } Standard.CHANGEFILTERSTRUCT pChangeFilterStruct = new Standard.CHANGEFILTERSTRUCT { cbSize = (uint)Marshal.SizeOf(typeof(Standard.CHANGEFILTERSTRUCT)) }; if (!_ChangeWindowMessageFilterEx(hwnd, message, action, ref pChangeFilterStruct)) { return((Standard.HRESULT)Standard.Win32Error.GetLastError()); } filterInfo = pChangeFilterStruct.ExtStatus; return(Standard.HRESULT.S_OK); }
private static extern bool _ChangeWindowMessageFilterEx(IntPtr hwnd, Standard.WM message, Standard.MSGFLT action, [In, Out, Optional] ref Standard.CHANGEFILTERSTRUCT pChangeFilterStruct);