Skip to content

Get text from the focused control in the window issue #7

@JecyG

Description

@JecyG

// Approach 1: Use EM_GETSELTEXT (works for rich edit controls) wchar_t buffer[8192] = {0}; int textLength = SendMessageW(focusedControl, EM_GETSELTEXT, 0, (LPARAM)buffer);

You must first invoke OpenProcess to open the target process, then call VirtualAllocEx to allocate memory, followed by SendMessage(hwnd, EM_GETSELTEXT, 0, (LPARAM)pRemoteBuf); because the edit box window belongs to another process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions