Skip to content

Commit

Permalink
Use MSBuild 15, make private explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrondeau committed Apr 29, 2017
1 parent c4a1315 commit 709d3ff
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 26 deletions.
7 changes: 1 addition & 6 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ Write-Host "Building Go To Window..." -ForegroundColor Green
# ==================================== Functions

Function GetMSBuildExe {
[CmdletBinding()]
$DotNetVersion = "14.0"
$RegKey = "HKLM:\software\Microsoft\MSBuild\ToolsVersions\$DotNetVersion"
$RegProperty = "MSBuildToolsPath"
$MSBuildExe = Join-Path -Path (Get-ItemProperty $RegKey).$RegProperty -ChildPath "msbuild.exe"
Return $MSBuildExe
Return "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"
}

Function ZipFiles($Filename, $Source)
Expand Down
2 changes: 1 addition & 1 deletion GoToWindow.Api/KeyboardHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public struct Kbdllhookstruct
private static extern IntPtr GetModuleHandle(string lpModuleName);

[DllImport("user32.dll")]
static extern short GetAsyncKeyState(int vKey);
private static extern short GetAsyncKeyState(int vKey);

// ReSharper disable InconsistentNaming
// ReSharper disable UnusedMember.Local
Expand Down
8 changes: 4 additions & 4 deletions GoToWindow.Api/WindowEntryFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ namespace GoToWindow.Api
public static class WindowEntryFactory
{
[DllImport("user32.dll")]
static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
private static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);

[DllImport("user32.dll")]
static extern int GetWindowTextLength(IntPtr hWnd);
private static extern int GetWindowTextLength(IntPtr hWnd);

[DllImport("user32.dll", SetLastError = true)]
static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint processId);
private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint processId);

[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool IsIconic(IntPtr hWnd);
private static extern bool IsIconic(IntPtr hWnd);

public static WindowEntry Create(IntPtr hWnd)
{
Expand Down
2 changes: 1 addition & 1 deletion GoToWindow.Api/WindowToForeground.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public struct RECT
public static extern IntPtr GetForegroundWindow();

[DllImport("user32.dll")]
static extern bool SetForegroundWindow(IntPtr hWnd);
private static extern bool SetForegroundWindow(IntPtr hWnd);

[DllImport("user32.dll")]
public static extern bool AttachThreadInput(uint idAttach, uint idAttachTo, bool fAttach);
Expand Down
21 changes: 10 additions & 11 deletions GoToWindow.Api/WindowsListFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class WindowsListFactory
private static readonly ILog Log = LogManager.GetLogger(typeof(WindowsListFactory).Assembly, "GoToWindow");
private const int MaxLastActivePopupIterations = 50;

delegate bool EnumWindowsProc(IntPtr hWnd, int lParam);
private delegate bool EnumWindowsProc(IntPtr hWnd, int lParam);

public enum GetAncestorFlags
{
Expand All @@ -27,29 +27,29 @@ public enum GetAncestorFlags
}

[DllImport("user32.dll")]
static extern bool EnumWindows(EnumWindowsProc enumFunc, int lParam);
private static extern bool EnumWindows(EnumWindowsProc enumFunc, int lParam);

[DllImport("user32.dll")]
static extern bool IsWindowVisible(IntPtr hWnd);
private static extern bool IsWindowVisible(IntPtr hWnd);

[DllImport("user32.dll")]
static extern IntPtr GetShellWindow();
private static extern IntPtr GetShellWindow();

[DllImport("user32.dll", ExactSpelling = true)]
static extern IntPtr GetAncestor(IntPtr hwnd, GetAncestorFlags flags);
private static extern IntPtr GetAncestor(IntPtr hwnd, GetAncestorFlags flags);

[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
private static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);

[DllImport("user32.dll")]
static extern IntPtr GetLastActivePopup(IntPtr hWnd);
private static extern IntPtr GetLastActivePopup(IntPtr hWnd);

[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool EnumChildWindows(IntPtr hwndParent, EnumWindowsProc lpEnumFunc, IntPtr lParam);
private static extern bool EnumChildWindows(IntPtr hwndParent, EnumWindowsProc lpEnumFunc, IntPtr lParam);

[DllImport("user32.dll", SetLastError = true)]
static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);

public static WindowsList Load()
{
Expand Down Expand Up @@ -258,8 +258,7 @@ private static IntPtr GetLastVisibleActivePopUpOfWindow(IntPtr window)
currentWindow = lastPopUp;
}

Log.Warn(
$"Could not find last active popup for window {window} after {MaxLastActivePopupIterations} iterations");
Log.Warn( $"Could not find last active popup for window {window} after {MaxLastActivePopupIterations} iterations");
return IntPtr.Zero;
}
}
Expand Down
2 changes: 1 addition & 1 deletion GoToWindow/Squirrel/SquirrelUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void Dispose()
Updater.Dispose();
}

static string GetUpdateUrl()
private static string GetUpdateUrl()
{
var args = Environment.GetCommandLineArgs();
var updateUrlArgumentIndex = Array.IndexOf(args, "-updateUrl");
Expand Down
2 changes: 1 addition & 1 deletion GoToWindow/Windows/FirstRunWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public FirstRunWindow(IGoToWindowContext context)
context.Showing += context_Showing;
}

void context_Showing(object sender, EventArgs e)
private void context_Showing(object sender, EventArgs e)
{
Close();
}
Expand Down
4 changes: 3 additions & 1 deletion Releases/RELEASES
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ EB4643E5BB697604318F7F164EC3AA9C6D386B9E https://github.com/christianrondeau/GoT
422CA8187828DB797877DF269A0F46FA1188DCF6 https://github.com/christianrondeau/GoToWindow/releases/download/v0.5.0/GoToWindow-0.5.0-full.nupkg 729945
75DCCAF719F4E44061C00EEEB65E34F89FE94272 https://github.com/christianrondeau/GoToWindow/releases/download/v0.5.1/GoToWindow-0.5.1-delta.nupkg 814219
AFD4F1BF5569DC0C61EEBD58B51DA1DF0EB76331 https://github.com/christianrondeau/GoToWindow/releases/download/v0.5.1/GoToWindow-0.5.1-full.nupkg 818603
137896C8168805F682C41E7134EF0B78768DDCC4 https://github.com/christianrondeau/GoToWindow/releases/download/v0.5.2/GoToWindow-0.5.2-full.nupkg 818711
137896C8168805F682C41E7134EF0B78768DDCC4 https://github.com/christianrondeau/GoToWindow/releases/download/v0.5.2/GoToWindow-0.5.2-full.nupkg 818711
0B73C88C6BD5EF170F2E69005771ADFCCB416D15 https://github.com/christianrondeau/GoToWindow/releases/download/v0.6.1/GoToWindow-0.6.1-delta.nupkg 275980
65A2746CA01D744D2E8E7578BBB9C948F398972F https://github.com/christianrondeau/GoToWindow/releases/download/v0.6.1/GoToWindow-0.6.1-full.nupkg 811105

0 comments on commit 709d3ff

Please sign in to comment.