public static IntPtr SetWindowLong(IntPtr hWnd, int nIndex, IntPtr dwNewLong) { IntPtr num1 = IntPtr.Zero; NotificationWindow.SetLastError(0); int lastWin32Error; if (IntPtr.Size == 4) { int num2 = NotificationWindow.IntSetWindowLong(hWnd, nIndex, NotificationWindow.IntPtrToInt32(dwNewLong)); lastWin32Error = Marshal.GetLastWin32Error(); num1 = new IntPtr(num2); } else { num1 = NotificationWindow.IntSetWindowLongPtr(hWnd, nIndex, dwNewLong); lastWin32Error = Marshal.GetLastWin32Error(); } if (num1 == IntPtr.Zero && lastWin32Error != 0) { throw new Win32Exception(lastWin32Error); } return(num1); }
public static void Init() { NotificationWindow.mInstance = new NotificationWindow(); SystemEvents.DisplaySettingsChanged -= new EventHandler(NotificationWindow.mInstance.HandleDisplaySettingsChanged); SystemEvents.DisplaySettingsChanged += new EventHandler(NotificationWindow.mInstance.HandleDisplaySettingsChanged); }