Пример #1
0
        internal static void RemoveWindowFromTaskbar(IntPtr targetWindowHandle)
        {
            var newStyle = (WindowExStyles)User32Helpers.GetWindowLongPtr(targetWindowHandle, WindowLongFlags.GWL_EXSTYLE);

            newStyle &= ~WindowExStyles.WS_EX_APPWINDOW;

            User32Helpers.SetWindowLongPtr(targetWindowHandle, WindowLongFlags.GWL_EXSTYLE, new IntPtr((long)newStyle));
        }
Пример #2
0
        internal static void MakeToolWindow(IntPtr targetWindowHandle)
        {
            var newStyle = (WindowStyles)User32Helpers.GetWindowLongPtr(targetWindowHandle, WindowLongFlags.GWL_STYLE);

            newStyle &= ~WindowStyles.WS_MAXIMIZEBOX;
            newStyle &= ~WindowStyles.WS_MINIMIZEBOX;

            User32Helpers.SetWindowLongPtr(targetWindowHandle, WindowLongFlags.GWL_STYLE, new IntPtr((long)newStyle));
        }
Пример #3
0
 internal static void MakeLayeredWindow(IntPtr targetWindowHandle)
 {
     User32Helpers.SetWindowLongPtr(
         targetWindowHandle,
         WindowLongFlags.GWL_EXSTYLE,
         new IntPtr(
             (int)User32Helpers.GetWindowLongPtr(targetWindowHandle, WindowLongFlags.GWL_EXSTYLE)
             | (int)WindowExStyles.WS_EX_LAYERED
             )
         );
 }
Пример #4
0
 internal static void SetWindowOwner(IntPtr targetWindoHandle, IntPtr parentWindowHandle)
 {
     User32Helpers.SetWindowLongPtr(targetWindoHandle, WindowLongFlags.GWLP_HWNDPARENT, parentWindowHandle);
 }