Skip to content

Commit

Permalink
Fix some broken things from 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Sampson committed Apr 12, 2017
1 parent 5476dff commit b1db035
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("9.0.33315.1328")]
[assembly: AssemblyFileVersion("9.0.33315.1328")]
[assembly: AssemblyVersion("9.1.33315.1328")]
[assembly: AssemblyFileVersion("9.1.33315.1328")]
[assembly: NeutralResourcesLanguage("en-US")]
5 changes: 5 additions & 0 deletions WindowsAPI/Enumerations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ public enum SystemMetric
REMOTECONTROL = 0x2001, // 0x2001
}

public enum WindowMessages : int
{
WM_SETREDRAW = 0xB
}

/// <summary>
/// Enumeration of the different ways of showing a window using ShowWindow
/// </summary>
Expand Down
11 changes: 5 additions & 6 deletions WindowsAPI/Manipulation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public static void MakeWindowBorderless(ProcessDetails processDetails, MainWindo
// | WindowStyleFlags.Border
//| WindowStyleFlags.DialogFrame
| WindowStyleFlags.ThickFrame
| WindowStyleFlags.OverlappedWindow
| WindowStyleFlags.SystemMenu
| WindowStyleFlags.MaximizeBox // same as TabStop
| WindowStyleFlags.MinimizeBox // same as Group
Expand Down Expand Up @@ -126,7 +127,9 @@ public static void MakeWindowBorderless(ProcessDetails processDetails, MainWindo
if (favDetails.HideMouseCursor)
ToggleMouseCursorVisibility(frmMain, Tools.Boolstate.False);


// update window styles
Native.SetWindowLong(targetWindow, WindowLongIndex.Style, styleNewWindowStandard);
Native.SetWindowLong(targetWindow, WindowLongIndex.ExtendedStyle, styleNewWindowExtended);

// update window position
if (favDetails.SizeMode != Favorites.Favorite.SizeModes.NoChange)
Expand Down Expand Up @@ -180,11 +183,7 @@ public static void MakeWindowBorderless(ProcessDetails processDetails, MainWindo
);
}

Thread.Sleep(1000);
// update window styles
Native.SetWindowLong(targetWindow, WindowLongIndex.Style, styleNewWindowStandard);
Native.SetWindowLong(targetWindow, WindowLongIndex.ExtendedStyle, styleNewWindowExtended);


// Make a note that we attempted to make the window borderless
if (processDetails != null)
{
Expand Down
5 changes: 1 addition & 4 deletions WindowsAPI/Native.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,7 @@ public static WindowStyleFlags GetWindowLong(IntPtr hWnd, WindowLongIndex nIndex
/// </summary>
public static WindowStyleFlags SetWindowLong(IntPtr hWnd, WindowLongIndex nIndex, WindowStyleFlags dwNewLong)
{
if (IntPtr.Size == 8)
return SetWindowLong64(hWnd, nIndex, dwNewLong);

return SetWindowLong32(hWnd, nIndex, dwNewLong);
return IntPtr.Size == 8 ? SetWindowLong64(hWnd, nIndex, dwNewLong) : SetWindowLong32(hWnd, nIndex, dwNewLong);
}

[DllImport("user32.dll")]
Expand Down

0 comments on commit b1db035

Please sign in to comment.