Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autosuggest passwords by window caption #69

Open
Erapchu opened this issue Apr 21, 2022 · 0 comments
Open

Autosuggest passwords by window caption #69

Erapchu opened this issue Apr 21, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Erapchu
Copy link
Owner

Erapchu commented Apr 21, 2022

Get window caption text

[DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)]
static extern int GetWindowTextLength(IntPtr hWnd);

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

public static string GetText(IntPtr hWnd)
{
    // Allocate correct string length first
    int length       = GetWindowTextLength(hWnd);
    StringBuilder sb = new StringBuilder(length + 1);
    GetWindowText(hWnd, sb, sb.Capacity);
    return sb.ToString();
}

And then, parse that text, split and try to suggest passwords - sort them

@Erapchu Erapchu self-assigned this Apr 21, 2022
@Erapchu Erapchu added the enhancement New feature or request label Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant