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

Updates to support writing to new Notepad on Windows 11 #60

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ public override void Flush()
// Get how many characters are in the Notepad editor after putting in new text
var textLengthAfter = User32.SendMessage(_currentNotepadEditorHandle, User32.WM_GETTEXTLENGTH, IntPtr.Zero, IntPtr.Zero);

// Determine if the write succeeded. This will break the loop.
succeeded = textLengthAfter != textLength;
bstordrup marked this conversation as resolved.
Show resolved Hide resolved

// If no change in the text length, reset editor handle to try to find it again.
if (textLengthAfter == textLength)
if (!succeeded)
{
_currentNotepadEditorHandle = IntPtr.Zero;
attempts++;
Expand Down