Skip to content

Commit

Permalink
Use different window finding func
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Dietzer authored and benpye committed Oct 8, 2018
1 parent 94a323a commit ac2a62a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PageantHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal PageantException(string message) : base(message)
static class PageantHandler
{
[DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName);
static extern IntPtr FindWindow(string lpWindowClass, string lpWindowName);

[DllImport("kernel32.dll")]
static extern uint GetCurrentThreadId();
Expand Down Expand Up @@ -88,7 +88,7 @@ struct COPYDATASTRUCT
// Send ssh-agent query to Pageant, ssh-agent and Pageant use same messages
internal static byte[] Query(ArraySegment<byte> buf)
{
var hwnd = FindWindowByCaption(IntPtr.Zero, "Pageant");
var hwnd = FindWindow("Pageant", "Pageant");
if (hwnd == IntPtr.Zero)
{
throw new PageantException("HWND not found");
Expand Down

0 comments on commit ac2a62a

Please sign in to comment.