private void ToggleWindowSticky(IntPtr hwnd)
 {
     try {
         if (WindowsDesktop.Interop.ComObjects.GetVirtualDesktopPinnedApps() == null)
         {
             WinAPI.SetWindowLongPtr(hwnd, WinAPI.GWL_EXSTYLE,
                                     WinAPI.GetWindowLongPtr(hwnd, WinAPI.GWL_EXSTYLE).XOR(WinAPI.WS_EX_TOOLWINDOW));
         }
         else
         {
             VirtualDesktopHelper.TogglePinWindow(hwnd);
         }
     } catch { }
 }
Exemplo n.º 2
0
 public static void TogglePin(this IntPtr hWnd)
 {
     VirtualDesktopHelper.TogglePinWindow(hWnd);
 }